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

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

html - Not able to access next element of an array javascript -