Pages

Tuesday, 27 August 2013

Common regular expression in ASP .Net

Regular expression for mobile number should be start from 7 or 8 or 9
regular expression that should accept Indian mobile numbers. for example...
9788812345
9876512345
7891234567
8122212345
Syntax :
[789][0-9]{9}
Prefixing an optional (+91|0)? could make it more usable.

Regular expression for email , should be taking only numeric domain name like:

abc133@jhjh.dfsd : True
456@jhj.hh : True
8678@656.687 : False
hgh@679.vhhv : False
hgh@jbnj.656 : False

Syntax :
"^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-a-zA-Z]+[.])+[a-zA-Z]{2,6}$"

No comments:

Post a Comment