Regular Expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OuTCasT
    Contributor
    • Jan 2008
    • 374

    #1

    Regular Expression

    Hi
    I need to do a check on telephone numbers entered into a textbox.
    I know the regular expression for an email address but not to check a telephone number like such (000)000-0000
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    ^(\()?(787|939) (\)|-)?([0-9]{3})(-)?([0-9]{4}|[0-9]{4})$

    Replace 787 and 939 with the telephone codes of your choice....

    Comment

    Working...