1. Verify Email
Email address, format:[email protected],[email protected]
"\[email protected]\w+\. [A-z]+ (\.[ a-z]+)? "
2. Verify the ID number
Resident ID Number 15 or 18 digits, the last one may be a number or a letter
"[1-9]\d{13,16}[a-za-z0-9]{1}"
3. Verify your phone number
Moving number segment: 134 (0-8), 135, 136, 137, 138, 139, 147 (expected for TD card)
150, 151, 152, 157 (TD-only), 158, 159, 187 (not enabled), 188 (TD-only)
China Unicom Number segment: 130, 131, 132, 155, 156 (world-specific), 185 (not enabled), 186 (3g)
Telecom Number segment: 133, 153, 180 (not enabled), 189
"(\+\d+)? 1[34578]\d{9}$"
4. Verify the fixed phone number
Phone number, Format: Country (region) telephone code + area code (city codes) + phone number
"(\+\d+)?" (\d{3,4}\-?)? \d{7,8}$ "
5. Verification Date (month date)
Date, Format: 1992-09-03, or 1992.09.03
"[1-9]{4} ([-./]) \d{1,2}\1\d{1,2}"
6. Verify the URL address
Format: http://blog.csdn.net:80/xyang81/article/details/7705960? or https://
"(https?:/ /(w{3}\.)?)? \w+\.\w+ (\.[ a-za-z]+)(: \d{1,5})? ( /\w)(\?? (.+=.)? (&.+=.*)?)? "
7. Matching IP address
Simple match, format, such as: 192.168.1.1,127.0.0.1, no matching IP segment size
"1-9?\. (0| (1-9?)) \. (0| (1-9?)) \. (0| (1-9?)) ";
8. Validating integers (positive and negative integers)
"\-? [1-9]\d+]
9. Verifying integers and floating-point numbers (plus and minus integers and positive and negative floating-point numbers)
"\-? [1-9]\d+ (\.\d+)? "
10. Verifying Chinese
"^[\u4e00-\u9fa5]+$"
Ten common Java Regular expressions