i need regex validate phone numbers:
conditions:
- it may have
+
sign @ beginning (optional) - then followed digits
- minimum 10 digits
- maximum 15 digits
thanks
you can try one:
^\+?\d{10,15}$
explanation:
^
marks start of string\+?
- \ escapes + sign , ? makes optional\d
digit between 0-9{10,15}
means minimum 10 digit , 15 means maximum 15$
marks end of string
p.s: solomon island has 5 digit phone numbers. country code can 8 digits
Comments
Post a Comment