Phone Number Regular Expressions

Category: Numbers | Views Total: 120 views

A collection of useful Regular Expressions to parse, validate, and format phone numbers around the world.

US (North American) Phone Numbers

A regular expression to format and validate US (North American) Phone Numbers:

  • 1234567890
  • 123-456-7890
  • 123.456.7890
  • 123 456 7890
  • (123) 456 7890
/^\\(?([0-9]{3})\\)?[-.\\s]?([0-9]{3})[-.\\s]?([0-9]{4})$/


UK Phone Numbers

A regular expression to format and validate UK Phone Numbers, which should contain 11 digits and are normally in the format (01234) 123123.

  • +447222555555
  • +44 7222 555 555
  • (0722) 5555555 #2222
/^(((\+44\s?\d{4}|\(?0\d{4}\)?)\s?\d{3}\s?\d{3})|((\+44\s?\d{3}|\(?0\d{3}\)?)\s?\d{3}\s?\d{4})|((\+44\s?\d{2}|\(?0\d{2}\)?)\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$/


French Phone Numbers

A regular expression to format and validate French Phone Numbers.

  • 0123456789
  • 01 23 45 67 89
  • 01.23.45.67.89
  • 0123 45.67.89
  • 0033 123-456-789
  • +33-1.23.45.67.89
  • +33 – 123 456 789
  • +33(0) 123 456 789
  • +33 (0)123 45 67 89
  • +33 (0)1 2345-6789
  • +33(0) – 123456789
/^(?:(?:\+|00)33[\s.-]{0,3}(?:\(0\)[\s.-]{0,3})?|0)[1-9](?:(?:[\s.-]?\d{2}){4}|\d{2}(?:[\s.-]?\d{3}){2})$/

German Phone Numbers

A regular expression to format and validate phone numbers in German format.

  • (06442) 3933023
  • (02852) 5996-0
  • (042) 1818 87 9919
  • 06442 / 3893023
  • 06442 / 38 93 02 3
  • 06442/3839023
  • 042/ 88 17 890 0
  • +49 221 549144 – 79
  • +49 221 – 542194 79
  • +49 (221) – 542944 79
  • 0 52 22 – 9 50 93 10
  • +49(0)121-79536 – 77
  • +49(0)2221-39938-113
  • +49 (0) 1739 906-44
  • +49 (173) 1799 806-44
  • 0214154914479
  • 02141 54 91 44 79
  • 01517953677
  • +491517953677
  • 015777953677
  • 02162 – 54 91 44 79
  • (02162) 54 91 44 79
/(\(?([\d \-\)\–\+\/\(]+){6,}\)?([ .\-–\/]?)([\d]+))/

Chinese Phone Numbers

A regular expression to format and validate telephone numbers in China.

  • 0936-4211235
  • 89076543
  • 010-12345678-1234
/^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/

Chinese Mobile Phone Numbers

A regular expression to format and validate mobile telephone numbers in China.

  • 008618311006933
  • +8617888829981
  • 19119255642
/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/

India Phone Numbers

A regular expression to format and validate India phone numbers and mobile numbers.

  • 03595-259506
  • 03592 245902
  • 03598245785
  • 9775876662
  • 0 9754845789
  • 0-9778545896
  • +91 9456211568
  • 91 9857842356
  • 919578965389
/((\+*)((0[ -]*)*|((91 )*))((\d{12})+|(\d{10})+))|\d{5}([- ]*)\d{6}/

Rate This Regex
Sending
User Review
0 (0 votes)

Leave a Reply