Character Class - interpreting too many metachars?
Brought to you by:
samokhodkin
the following regex throws an exception:
\sCOPY\s[^{\n]*\{\d{4,}\}
jregex.PatternSyntaxException: unknown named class:
{\n]*\\d4,}
this seems to be an error as http://www.pcre.org/pcre.txt
states the valid metacharacters in a character class are
\ general escape character
^ negate the class, but only if the first
character
- indicates character range
[ POSIX character class (only if followed
by POSIX
syntax)
] terminates the character class
I'm aware that I can write as
\sCOPY\s[^\{\n]*\{\d{4,}\}
however other engines seem to work without the extra \.