Processing of the pattern argument in yangtools fails for some valid XML schema regular expressions as required by RFC 7950.
For example, yangtools failed to process the following pattern:
pattern '[\i-[:]][\c-[:]]*';
It appears that yangtools do not recognize the following multi-character escape sequences:
- \c
- \C
- \i
- \I
And also it does not interpret character class subtraction correctly and pattern matching does not work.
For example, the following pattern should not match 'c' but it does:
pattern '[a-z-[c]]'
Proposal solution:
Implement logic in the RegexUtils class to translate XSD patterns into Java-compatible regex. This can be achieved similarly to the method shown in this code: