asp.net MVC 4 conditional regex in model validation

TogTooftflugh

New Member
I am new to regex and am validating a phone number. If the phone number starts with 011. The number can be greater than 10 digits. If it doesn't start with 011 it must be between 10-15 digits. Currently I have (?(011)\d{10, 15}|\d{7,}) but that is not working. I know I am missing something just can't figure out what it is. Thank you.
 
Back
Top