I'm looking for a simple regex exp that will validate a phone number. The number can be between 8 an 10 digits and there can be no other characters. Can someone help out?
It looks like ^[0-9]{8,10}$ does the trick.
Thanks for all the suggestions.
You could try this regex:
^[2-9]{2}\d{6,8}$
\d{8,10}
: would be the simplest way
Haven't checked it but i guess this will work [2-9][0-9]{7,9}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With