Name
Expression: ^([a-zA-Z]+(?:\.)?(?: [a-zA-Z]+(?:\.)?)*)$
Description: It takes only alphabets with single dot operator. Not take space at beginning. For example Mr. Santosh Kumar, vinod gupta etc.
Email
Expression: ^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$
Description: It validates email address.
Alphanumeric Character
Expression: ^(?=.*\d)(?=.*[A-Za-z])[A-Za-z0-9]{1,10}$
Description: It takes combination of alphabets and numbers. Not allow special character and white space in beginning.
Number
Expression: ^\d+$
Description: It allow entered only numbers. For example 2561.
Integer
Expression: ^-{0,1}\d*\.{0,1}\d+$
Description: It allow entered to integer values. For example -998, -198.00, 1700.00.
ZIP Code (Indian)
Expression: ^([1-9])([0-9]){5}$
Description: It allows entering Indian postal zip code. Indian postal zip code has six digits. For example 320001.
ZIP Code (US)
Expression: ^\d{5}(-\d{4})?$
Description: this expression validate for US based zip code.
Date (mm/dd/yyyy)
Expression: (0[1-9]|1[012])[ /](0[1-9]|[12][0-9]|3[01])[ /]([0-9]{4})
Description: Above expression take date in mm/dd/yyyy (month/date/year) format.
File Format (.doc, .docx, .pdf)
Expression: ^.+\.(([dD][oO][cC][xX])|([dD][oO][cC])|([pP][dD][fF])|([wW][pP][dD]))$
Description: This expression allows only .doc, .docx (for ms word) and .pdf format.
Mobile Number (India)
Expression: ^[789]\d{9}$
Description: This expression allow to take 10 digit numeric vales, stating from 9,8,7 only.
Mobile Number (US)
Expression: ^(\(?[0-9]{3}\)?)?\-?[0-9]{3}\-?[0-9]{4}$
Description: This expression allows taking US format mobile number. For example 987-987-9876.
Password (Strongly Type)
Expression: ^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\W)\S{6,15}$
Description: Above expression take minimum 6 digit and maximum 15 digit characters in textbox with at least one Uppercase, one lowercase, one numeric value and one special character
thank you sir,
ReplyDelete