This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Thanks to all. I will follow the tutorials and come back with the answers and doubts
thanks in advance
Joined: Oct 13, 2005
That regex seems to have repeated elements. If you work out what the repeating element in square brackets means, you are a long way towards solving the whole problem.
Joined: Dec 18, 2011
I have learned the basics of regular expression. Thanks to all. I got one problem with my regex.
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.
I am getting the following error:
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.
Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here