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
Post a Comment