Skip to:
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:
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:
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:
https://github.com/apache/netbeans/blob/e8fb660e9fe47f14991e46a22ffcb38bf37bab75/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/SchemaRep.java#L1624
Reproducer for this bug:https://git.opendaylight.org/gerrit/c/yangtools/+/111365
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:
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:
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:
https://github.com/apache/netbeans/blob/e8fb660e9fe47f14991e46a22ffcb38bf37bab75/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/SchemaRep.java#L1624