[YANGTOOLS-658] Escape Meta-characters like $, ^ in Regular Expression provided in pattern statement Created: 05/Sep/16 Updated: 10/Apr/22 Resolved: 12/Jan/17 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Kaja Mohideen | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||||||||||
| External issue ID: | 6630 | ||||||||||||||||
| Description |
|
Pattern statement (RFC 6020, Section 9.4.6) accepts regular expression defined by XSD Schema Spec (https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#regexs) which doesn't have meta-characters like ^ and $. XSD Schema definition of RegExp expects to match the entire string and so Yangtools is correctly returning the pattern defined in Yang enclosed within ^ and $. But, it doesn't escape these characters if they are found inside the pattern value. Due to this issue, attempts to use PatternConstraint::getRegularExpression as is with Java Pattern/Matcher classes doesn't work as expected. |
| Comments |
| Comment by Kaja Mohideen [ 05/Sep/16 ] |
|
Issue uncovered while trying to use YT to parse the iana-crypt-hash yang module (https://tools.ietf.org/html/rfc7317#section-5) |
| Comment by Peter Kajsa [ 06/Sep/16 ] |
|
It seems that solution of Bug-5410 should resolve also this issue. |
| Comment by Kaja Mohideen [ 12/Jan/17 ] |
|
1. I couldn't find the relevant code change that could have solved this issue. |
| Comment by Igor Foltin [ 12/Jan/17 ] |
|
This issue is addressed in the following bug - https://bugs.opendaylight.org/show_bug.cgi?id=5410 However, the bug has not been resolved yet and it is planned for Carbon M5. |