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?
Asked
Active
Viewed 2.4k times
5 Answers
7
You could try this regex:
^[2-9]{2}\d{6,8}$
![](../../users/profiles/29407.webp)
Darin Dimitrov
- 960,118
- 257
- 3,196
- 2,876
-
5Phone numbers in many countries start with 0, not 2-9... Why so many upvotes? – Gone Coding Jun 19 '12 at 11:09