Continuing with the post at http://stackoverflow.com/questions/705672/regular-expression-to-allow-a-set-of-characters-and-disallow-others/705990#705990
Does anybody know why the below would occur?
I get the below error when I create a regular expression as:
[^@*–’”“\r\nœçsÇSgGšcrŠRNEŽDTCnežuUIti—¿„”]+
and enter any of these restricted characters in the input field
java.lang.ArrayIndexOutOfBoundsException
at org.apache.regexp.RECompiler$RERange.delete(RECompiler.java:1326)
at org.apache.regexp.RECompiler$RERange.remove(RECompiler.java:1417)
at org.apache.regexp.RECompiler$RERange.include(RECompiler.java:1459)
at org.apache.regexp.RECompiler$RERange.include(RECompiler.java:1470)
at org.apache.regexp.RECompiler.characterClass(RECompiler.java:699)
at org.apache.regexp.RECompiler.terminal(RECompiler.java:863)
at org.apache.regexp.RECompiler.closure(RECompiler.java:942)
at org.apache.regexp.RECompiler.branch(RECompiler.java:1151)
at org.apache.regexp.RECompiler.expr(RECompiler.java:1203)
at org.apache.regexp.RECompiler.compile(RECompiler.java:1281)
at org.apache.regexp.RE.(RE.java:495)
at org.apache.regexp.RE.(RE.java:480)
but this expression works perfectly fine
[^@*–’”“\r\nœçsÇSgGšcrŠRN]+
Also,
[^@*–’”“\r\nœçsÇSgGšcrŠR„”]+
works but
[^@*–’”“\r\nœçsÇSgGšcrŠRNE]+
does not work and gives the above error.
Is there a limit to the number of characters that can be disallowed like the way above?
Regards, Udit Sud