[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF]
The above line showing illegal character range exception. Can anyone please help me.
if i use the above line in java code directly, it is not showing any error.
Pattern xmlInvalidChars = Pattern.compile("[^\\u0009\\u000A\\u000D\\u0020-\\uD7FF\\uE000-\\uFFFD\uD800\uDC00-\uDBFF\uDFFF]");
But if get the string from configuration xml file and use in the java code, it is showing error.
String chars = ConfigLoader.getInstance().getInvalidCharacters();
Pattern xmlInvalidChars = Pattern.compile(chars);
\uDC00-\uDBFF, this range is out of order. What do you need to match with the pattern? Maybe you need to remove the hyphen to remove the faulty range? Also, you need single backslashes in the XML.