I'd like to write a custom jQuery validator method to validate a phone number and I need help with the regex for it.
It's for international phone number so it needs to accept only 10-15 digits. One more condition here is that I have a phone mask already in place:
+___ ___ ___ ___ ___
(There's +
and 15 counts of underscores here).
The regex should possibly ignore the +, and the underscores, and any number of digits that is between 10-15 should be accepted as a valid phone number. screenshot of the phone area field is here
Possible accepted numbers:
+2345678901_____
+23456789012____
+234567890123___
+2345678901234__
+23456789012345_
+234567890123456
Thank you for your help!