The standard GSM character set contains the letters of the English alphabet, digits and some special characters, including a few Greek ones.
GSM character list: here The Unicode character list contains symbols from the Cyrillic, Chinese, Arabic, Korean and Hangul alphabets.
=.*[@#$%]) # must contains one special symbols in the list "@#$%" . mkyo Ng12* , special symbol “*” is not allow here 4. MKYONG12$ , lower case character is required Unit test with Test NG.
# match anything with previous condition checking # length at least 6 characters and maximum of 20 ) # End of group Whole combination is means, 6 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol (“@#$%”). Password is valid : [email protected] , true Password is valid : mk YOn12$ , true Password is valid : m [email protected] , false Password is valid : [email protected] , false Password is valid : mkyo Ng12* , false Password is valid : mkyon G$$ , false Password is valid : MKYONG12$ , false PASSED: Valid Password Test([ String;@116471f) =============================================== com.mkyong.regex.
Input Validation should not be used as the primary method of preventing XSS, SQL Injection and other attacks which are covered in respective cheat sheets but can significantly contribute to reducing their impact if implemented properly.
Input validation should be applied on both syntactical and semantic level.
This regular expression pattern is very useful to implement a strong and complex password.