Regular often used

Password: password of letters, numbers, 8 to 20 characters in length, it does not include characters String regPwd = "^ [a-zA-Z0-9] {8,20} $";

邮箱:  String regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";

Account name: account name comprising 3 to 10 letters, numbers, characters not included String regAccount = "^ ([A-Za-z0-9] {3,10}) $";

ID: String regCert = "^ [1-9] \\ d {5} (18 | 19 | ([23] \\ d)) \\ d {2} ((0 [1-9]) | ( 10 | 11 | 12)) (([0-2] [1-9]) | 10 | 20 | 30 | 31) \\ d {3} [0-9Xx] $ ";

Authentication: aaaa.matches (regPwd);

This is the simplest regular, but if you did not know, that is the bible

Guess you like

Origin www.cnblogs.com/senjiang/p/12016782.html