Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RegExp support for custom tag #552

Closed
tianranwangcs opened this issue Jun 3, 2020 · 2 comments
Closed

RegExp support for custom tag #552

tianranwangcs opened this issue Jun 3, 2020 · 2 comments

Comments

@tianranwangcs
Copy link

Say there is a set of custom tags like !customTag1, !customTag2, !customTag3 ... in the yaml file. We don't know the number of such tags before loading it. Is there a way to use RegExp /!customTag[\d]*/ when creating schemas?

@puzrin
Copy link
Member

puzrin commented Nov 28, 2020

This parser does not use regexp, but your demand can be done via #385 when complete.

@puzrin puzrin closed this as completed Nov 28, 2020
@rlidwka
Copy link
Member

rlidwka commented Dec 25, 2020

Added in 73ef02c (currently in dev branch).

See an example how to do it here:
https://github.com/nodeca/js-yaml/blob/a0d0caa5aa0f5354fefa9c637cfb7c4c17ef7d02/examples/handle_unknown_types.js

Note that it works using prefix, not RegExp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants