8
Answers

Regular Expression for mobile number

sameer shaikh

sameer shaikh

8y
213
1
Hi 
 
I have created a simple model,there is Mobile number property and i want to apply restriction on that.
I am using this (@"^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$") but problem is length of digit must 10 and foreign mobile number may not be 10 digit.
how to apply validation on mobile number, this will be for indian and also foreign user.
so please let me know which regular expression is better for to solve this problem.
 
Answers (8)