Swapna latha wrote:My regex is written in such a way that it should not allow alpha numeric, and special characters. Thats fine, but its failing in one scenario for targetPage and that is Prestige$%$lll.jsp. How to make sure that it should work.
Fairly obviously, by making sure that it 'understands' the "%nn" syntax.
My suggestion: write a little program that does this using ONLY standard
String methods, and
then translate it to a regex. You may find that your program is actually
faster than a regex; and for something complicated like this, it's highly likely to be more readable too.
Winston