I need to validate a text field in my registration form for which I want a Regex.
The textbox will accept a mobile number like 9999999999(10 digit - starting with 7 or 8 or 9). The user may alternatively write +919999999999, where +91 is country code (+91 for India, but can accept any other like +110 or +52), or he may also write 09999999999 (first 0 for own country)
Here, the user have 3 choices,
- adding the mobile number with country code
- simply without country code or 0 prefixed
- With a zero prefixed in mobile number.
Though not required, my page is in asp.net, and I am using built-in regular expression validator.