Index | Name | RegExp | Test |
---|---|---|---|
1 | Uppercase letter | /^[A-Z]+$/ | |
2 | Lowercase letter | /^[a-z]+$/ | |
3 | Decimal digit | /^\d+$/ | |
4 | Hexadecimal digit | /^[0-9A-Fa-f]+$/ | |
5 | Letters and digits | /^[A-Za-z0-9]+$/ | |
6 | ASCII characters | /^[\x00-\xff]+$/ | |
7 | Non-ASCII characters | /^[^\x00-\xff]+$/ | |
8 | Full width characters | /^[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE]+$/ | |
9 | Half width characters | /^[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE]+$/ | |
10 | CJK characters | /^[\u1100-\u11ff\u2e80-\u2fdf\u3040-\u318f\u3200-\u4dbf\u4e00-\u9fff\ua960-\ua97f\uf900-\ufaff\u3000-\u303f\uac00-\ud7af\ufe10-\ufe1f\ufe30-\ufe6f\uff00-\uff60\uffe0-\uffef]+$/ | |
11 | Decimal number | /^[+-]?(?:\d+\.?\d*|\.\d+)(?:[e|E][+-]?\d+)?$/ | |
12 | Decimal fraction | /^[+-]?\d*\.\d+$/ | |
13 | /^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~])*@[a-zA-Z](-?[a-zA-Z0-9])*(\.[a-zA-Z](-?[a-zA-Z0-9])*)+$/ | ||
14 | Domain | /^((https?):\/\/)?[^\s].[^\s]*$/i | |
15 | IPv4 | /^(?:25[0-5]|2[0-4][0-9]|1\d{2}|[1-9]?\d)\.(?:(?:25[0-5]|2[0-4][0-9]|1\d{2}|[1-9]?\d)\.){2}(?:25[0-5]|2[0-4][0-9]|1\d{2}|[1-9]?\d)$/ | |
16 | /^[1-9]\d{4,}$/ | ||
17 | Chinese phone number | /^1\d{10}$/ | |
18 | Chinese telephone number | /^\d{7,8}$/ | |
19 | Chinese identity number | /^(\d{15}|\d{18})$/ | |
20 | Hex Color | /^#([0-9A-F]{3}|[0-9A-F]{6})$/i | |
21 | RGB | /^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/ | |
22 | RGBA | /^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*0?\.?\d+\s*\)$/ | |
23 | HSL | /^hsl\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/ | |
24 | HSLA | /^hsla\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*0?\.?\d+\s*\)$/ |