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 3.1k times
        
    5 Answers
19
            It looks like ^[0-9]{8,10}$ does the trick.
Thanks for all the suggestions.
 
    
    
        dlarkin77
        
- 867
- 1
- 11
- 27
8
            
            
        You could try this regex:
^[2-9]{2}\d{6,8}$
 
    
    
        Darin Dimitrov
        
- 1,023,142
- 271
- 3,287
- 2,928
- 
                    5Phone numbers in many countries start with 0, not 2-9... Why so many upvotes? – iCollect.it Ltd Jun 19 '12 at 11:09
 
     
    