Reputation: 7
I am trying to do a validation check on mobile number from both C# code and Javascript.
Following should be validated OK:
I tried using:
C# code:
@"(^((([0-9]{5})|((\+[0-9]{2})[0-9]+)|((00[0-9]{2})[0-9]+))|((([0-9]{8,})|((\+[0-9]{2})[0-9]+)|((00[0-9]{2})[0-9]+))))$)"
JavaScript:
/^((([0-9]{5})|(((00[0-9]{2})|(\+?[0-9]{2}))[0-9]+))|(([0-9]{8})|(((00[0-9]{2})|(\+?[0-9]{2}))[0-9]+)))$/
With these expressions I am able to validate for 1st and last requirement but not the 2nd one (+XXxxxx).
Please help me out on this issue.
Upvotes: 1
Views: 376