US Phone Number with extension, flexible


/ Published in: Regular Expression
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ^((1|+1)?( |-|.)?)?((?[0-9]{3})?|[0-9]{3})( |-|.)?([a-zA-Z0-9]{3}( |-|.)?[a-zA-Z0-9]{4})[ ]*(( |x|ext|ext.|extension|Ext|Ext.|Extension|#){1}[ ]?([0-9]){1,7}){0,1}$
  2.  
  3. matched
  4. (223)456 7891 x 123
  5. (223)456 7891 ext 123
  6. (223)456 7891 ext. 123
  7. (223)456 7891 Ext 123
  8. (223)456 7891 Ext. 123
  9. (910)456-8970 x12
  10. (910)456-8970 #12
  11. (910)456-8970 extension12456
  12. (910)456-8970 Extension 12456
  13. 234.445.6789
  14. 987 765-8765
  15. 1 (453) 876 9876
  16. +1 (453) 876 9876
  17. (800)ABCDEFG
  18. (800) ABC-1234
  19.  
  20. not matched
  21. 2 (453) 876 9876
  22. (4534) 876 9876
  23. (453) 8764 9876
  24. (453) 876 98769

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.