Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
4079
Description
Given Yang snippet:
type string {
pattern "(\p
}
evokes:
[WARNING] Unable to compile pattern defined in module <name> at line <line>. Error message: Unknown character script name {BasicLatin} near index <column>
^(\p{IsBasicLatin}
|\p
{IsLatin-1Supplement})*$
Poblem comes from the fact that in the XML Schema specification,
Unicode character blocks are matched by "\p
" [1],
whereas Java expects "\p
" [2].
[1] http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#nt-IsBlock
[2] http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html
This needs to be fixed.
For time being, these are two possible workarounds:
1)
type string {
pattern "(\p
|\p
{InLatin-1Supplement})*
}
2)
type string {
pattern "([\x00-\x7F]|[\x80-\xFF])*
}