0

I need help writing a regular expression for a fax number. I need it to be option to have the country code. I need it to allow dashes in the country code.

Country code example:1-264 Fax Number with country code: 1-264 (555)-555-5555 Fax Number with country code: 1-264-(555)-555-5555 Fax Number with country code: 1-264-555-555-5555 either of these are allowed

I am using this in javascript but i just need the expression.

Current Code: ^(+\d{1,5}\s)?(?\d{3})?[\s.-]?\d{3}[\s.-]?\d{4}$

bryan3045
  • 1
  • 2
  • Does this answer your question? [A comprehensive regex for phone number validation](https://stackoverflow.com/questions/123559/a-comprehensive-regex-for-phone-number-validation) – High Performance Mark Nov 06 '19 at 14:38
  • no this is for phone numbers. Country codes are longer and allow dashes in them – bryan3045 Nov 06 '19 at 14:45

0 Answers0