Some Regular Expressions

Lakhangarg
Posted by Lakhangarg under Regular Expressions category on | Views : 3083
^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$


The above regular expression enforces the following rules:

* Must be at least 10 characters
* Must contain at least one one lower case letter, one upper case letter, one digit and one special character
* Valid special characters (which are configurable) are - @#$%^&+=

^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$


Password matching expression. Password must be at least 4 characters, no more than 8 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit.

Thanks & Regards
Lakhan Pal Garg
http://lakhangarg.blogspot.com/

Comments or Responses

Login to post response