Showing posts with label Regular Expressions. Show all posts
Showing posts with label Regular Expressions. Show all posts

Thursday, January 27, 2011

Most frequently used Regular Expressions in Java.


Username :
------------


 ^[a-z0-9_-]{3,15}$

Notes :

 ^             Start of the line
[a-z0-9_-]   supported chars and symbols in the list:  a-z, 0-9 , underscore ,hyphen
{3,15}         Length at least 3 characters and maximum length of 15
$         End of the line.


Password :
----------

((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})

Notes :

  (?=.*\d)  must contains one digit from 0-9
  (?=.*[a-z])  must contains one lowercase characters
  (?=.*[@#$%])  must contains one special symbols in the list "@#$%"

Let us see more

subversion video