0

I need a Regex pattern that can handle U.S. and U.K. phone numbers but does not allow numbers less than 6 digits. It should be able to accept this type of number as well: 00353872748226 but not be any longer than that. I have been tinkering with different Regexes all day and cannot get it to satisfy all of these requirements, no matter how hard I try. Please advise.

Here is the Regex I have so far: ^\s*(?:+?(\d{1,3}))?([-. (](\d{3})[-. )])?((\d{3})[-. ](\d{2,4})(?:[-.x ](\d{1,2}))?)\s*$

Thanks for your help.

  • can you give some examples of UK numbers – Muhammad Soliman Nov 28 '17 at 23:01
  • You might need to do at least two? similar post for a while back that was never fully answered: https://stackoverflow.com/questions/4014326/phone-number-regular-expression-for-uk-and-us-phones – boethius Nov 28 '17 at 23:01
  • instead of making it complex, don't it in one match .. separate you patterns/match as couple of options... something like this ^(..UK..)|(.US.)|(.OTHER.)$ – Muhammad Soliman Nov 28 '17 at 23:05

0 Answers0