简体   繁体   中英

ASP.Net Validation Expressions for Phone Numbers

I need a Validation Expression to validate an Egyptian mobile number as an input in my form.

Egyptian Mobile Number:

  • must Contain 11 Digits
  • must Begin with '01'
  • the third digit must be either '2' or '1' or '0'

Do you need to support starting '+' characters, spaces or '-' signs inside your phone number? If you don't and you need to support just exact what you said then you can use this pattern:

"^01[0-2][0-9]{8}$"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM