Java regex Pattern matches doesn't recognise "Escape +" -
this question has answer here:
i trying pattern ^\\+[0-9]+
match +852(2)78911
, seems
pattern.matches("^\\+[0-9]+", s)
is returning false
. when tried in regexr working fine i.e. giving me match. not escaping correctly in java sense?
try regex instead: ^\\+[0-9\\(\\)]+$
Comments
Post a Comment