1 :- [\w-]+@([\w-]+\.)+[\w-]+
2 :- (?
3 :- ^[\w\.=-]+@[\w\.-]+\.[\w]{2,3}$
4 :- /(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@
([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i
Regular Expression to validate US-Phone number.
Example :- (999) 999-9999 or (999)123-7869
1 :- /^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/
Regular Expression which validate string which contains only valid numbers.
1 :- /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/
Regular Expression which validate string which contains only valid integer numbers.
1 :- /(^-?\d\d*$)/
Regular Expression to validate US-Zip Code
1:- /(^\d{5}$)|(^\d{5}-\d{4}$)/;
Regular Expression to check any social number :-
Replace 9 by any valid nuber you want to check
1 :-/^\d{9}$/
Expression to check amount example :- 100,100.00,$100,$100.00
1 :- /^((\$\d*)|(\$\d*\.\d{2})|(\d*)|(\d*\.\d{2}))$/
Regular Expression to check IP Address (0-255):-
/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/
Regular Expression to check Time :-
/^([1-9]|1[0-2]):[0-5]\d(:[0-5]\d(\.\d{1,3})?)?$/
Like :- HH:MM:SS, HH:MM, HH:MM:SS.mmm
A very good collection of expressions no need to search anywhere or to store you provided a lot. Thank you .Please post some more expressions Thanks in advance
ReplyDelete