Pretty simple question - validating International Mobile/Landline Number using Data Annotations.
Any suggestions?
There is no single "international" phone number standard, but you can do some validation. For example:
[RegularExpression(@"^([\+]|0)[(\s]{0,1}[2-9][0-9]{0,2}[\s-)]{0,2}[0-9][0-9][0-9\s-]*[0-9]$")]
This allows, for example: 044 123-456, +2 12-12456, +(234) 56-56-452. See here for more kinds of regular expressions for phone numbers:
http://regexlib.com/Search.aspx?k=phone+number&c=0&m=0&ps=20&p=12
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With