I have a problem with the % and / characters in Java regex. The following example will illustrate my issue:
Pattern pattern = Pattern.compile("^[a-z]*[/%]$");
Matcher m = pattern.matcher("a%/");
System.out.println(m.find());
It prints "false" when I expect it to be "true". The % and / sign shouldn't have to be escaped but even if I do it still dosn't work.
So my question is simply why?