Help needed with Regex Code | XM Community
Skip to main content
Question

Help needed with Regex Code

  • February 5, 2021
  • 2 replies
  • 23 views

Forum|alt.badge.img+3

Can someone please help me to write a regex code so that I can validate a phone number to be a Mexico Phone Number?

2 replies

Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • February 5, 2021

Regex is pattern matching. Do you have a list of "Mexico phone number" patterns?


Forum|alt.badge.img+3

Thanks for the response Ahmed. Validity for Mexico Phone Number would be, it should be 10 digits long. However, the tricky part is first 2/3 digits would be the area code. For example -
Guadalajara numbers starts with 33
Mexico City with 55/56
Durango with 618, etc.