3 Responses

  1. shubham jain
    shubham jain at | | Reply

    Thanks for regular expression.

    I have modified your regular expression that works for following US phone number.

    regExp -> /^[+]?[0-9]{0,1}[-. ]?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/

    1444-555-1234
    1-444-555-1234
    14325678901
    1(123)456-7890
    +1 246.555-8888
    +1 (123)456-7890
    +1(123)456-7890

    Thanks,
    Shubham

  2. manmohan
    manmohan at | | Reply

    Thank you Subham it helped me a lot

  3. jpeavey
    jpeavey at | | Reply

    This works for the format, doesn’t actually ensure valid phone numbers. See http://www.regexplanet.com/cookbook/phone-number-nanp/index.html

Leave a Reply

%d bloggers like this: