is composed of numbers, letters, and special characters:
public static void Main (string[] args) {
String s = "122~!@#$%^&* () 222222a";
String r = "^ (? =.*\\d.*) (? =.*[a-za-z].*) (? =.*[-' ~!@#$%^&* () _+\\|\\\\=,./?><\\{\\}\\[\\]].*). *$";
System.out.println (S.matches (R));
}
The string must consist of a character + number + special character, or false
String s = "122~!@#$%^&* () 222222a"; s = "122AS_WEEWR"; String r = "^ (? =.*\\d.*) (? =.*[a-za-z].*) (? =.*[-' ~!@#$%^&* () _+\\|\\\\=,./?><\\{\\}\\[\\]].*). *$"; System.out.println (S.matches (R));
Modified, must be composed of characters and numbers:
s = "abcdefjd1"; r= "^ (? =.*\\d.*) (? =.*[a-za-z].*). *$"; System.out.println (S.matches (R));
Javascript:
var opwd = new Ext.form.TextField ({blanktext:false, inputtype: ' Password ', maxlength:20, Minlength:3, Fieldlabel: ' Confirm password ', Allowblank:false, regex:/^ ([a-z]+[0-9]+) | (
[0-9]+[a-z]+)] [a-z0-9]*$/i, Regextext: ' Password must be a mixture of 8-digit letters and Numbers '});