regex - Phone regular expression with dots and slashes -


i have simple regular expression check phone numbers: \+?(?:\d ?){7,20}

it´s working phones like:

  • 0034 123 456 789
  • +34123456789

and mix of that.

i include extend validation detecting "." or "-". example:

  • 0034.123.456.789
  • 123-456-789

you can use character class instead of final space of non-matching group :

\+?(?:\d[ .-]?){7,20} 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -