Saturday, 10 August 2013

erorr while entring regex in brackets of pattern matcher

erorr while entring regex in brackets of pattern matcher

when I use the following code i got error inside the brackets :
Matcher matcher = pattern.matcher("/Date\(\d+\)/");
The error is :invalid escape sequence (valid ones are \b \t \n \f \r \" \'
\\ ) I have tried also to change the value in the brackets
to('/Date\(\d+\)/'); without any success , how can i avoid this error?

No comments:

Post a Comment