-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fix regex pattern when caret and dollar sign exists in the pattern #22
Conversation
@llhotka -- Do you mind reviewing this PR? |
This is not correct. YANG uses the XSD flavour of regular expressions in which the characters
matches the string Correction: The |
@llhotka I understand ^ and $ are their literal meaning. Please see https://github.com/openconfig/public/blob/master/release/models/types/openconfig-inet-types.yang#L81 which this is currently trying to solve since we don't want to include the ^ and $ meaning in the pattern. |
Yangson is based on IETF standards, OpenConfig folks often don't care too much about them. In this case, I believe they use another flavour of regular expressions, so there may possibly be other differences apart from the |
@llhotka Would you consider a PR that let's yangson choose between XSD style regexes (the default) and posix? Something like:
Defaulting to XSDRegex, of course, to avoid changing the current behavior unless told explicitly. I understand it's all Openconfig's fault but not supporting the best known repository of yang models feels like a big loss. Also, PosixRegex is better understood and more widely used. |
@dbarrosop This would make sense if the regex flavour is somehow declared in the YANG module, because otherwise it would be difficult to combine YANG modules using different flavours. I started a thread on this in the NETMOD mailing list. |
Yeah, I agree, ideally openconfig wouldn't break the standard... I am going to evaluate forking openconfig and fixing the regexes, if that turns out to be a reasonable alternative I will go that way, otherwise, I will show up here again to see if there is something we can do to fix this in the short-term. I am a huge fan of yangson and jetconf and wouldn't want to have to look for alternatives because of Openconfig... :( Awesome work by the way, huge fan of yangson and jetconf as I said :) |
No description provided.