asRuleValue is [^0-9a-zA-Z"'-.#, ]
Pattern classPattern = Pattern.compile(asRuleValue, Pattern.CASE_INSENSITIVE);
Matcher m = classPattern.matcher(asValue);
if (!m.find())
{
lbFlag = true;
}
is not working properly for some scenarios like for () what am I doing wrong here?
You need to escape the
-in your character class or put it to the end.Use:
otherwise you are creating a character range from
'to.that includes also()*+,