Create the patterns to search digit , upper case alphabet , lower case alphabet and special character
Pattern digit = Pattern . compile ( " ( \\ d ) " ) ; Pattern upper = Pattern . compile ( " ( [ A - Z ] ) " ) ; Pattern lower = Pattern . compile ( " ( [ a - z ] ) " ) ; Pattern spChar = Pattern . compile ( " ( \\ W ) " ) ;