0
Posted on 10:29 PM by prajeesh and filed under ,
Here is the list of some commonly used reguler expressions for validating your forms.
E-mail
^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$
URL
^(htf)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$
Social Security Number
^\d{3}-\d{2}-\d{4}$
Phone number(Validates US Phone number)
^[01]?[- .]?(\([2-9]\d{2}\)[2-9]\d{2})[- .]?\d{3}[- .]?\d{4}$
Zip Code(Validates US Zip code)
^(\d{5}-\d{4}\d{5}\d{9})$^([a-zA-Z]\d[a-zA-Z] \d[a-zA-Z]\d)$
Currency(Non Negative)
^\d+(\.\d\d)?$
Currency(+ve or -ve)
^(-)?\d+(\.\d\d)?$
Non Negative Integer
^\d+$
For a detailed article on reguler expressions, refer : http://msdn.microsoft.com/en-us/library/ms972966.aspx Shout it kick it on DotNetKicks.com
0
Responses to ... some commonly used reguler expressions