Common Regular Expression (JavaScript)

Index
Name
RegExp
Test
1Uppercase letter/^[A-Z]+$/
2Lowercase letter/^[a-z]+$/
3Decimal digit/^\d+$/
4Hexadecimal digit/^[0-9A-Fa-f]+$/
5Letters and digits/^[A-Za-z0-9]+$/
6ASCII characters/^[\x00-\xff]+$/
7Non-ASCII characters/^[^\x00-\xff]+$/
8Full width characters/^[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE]+$/
9Half width characters/^[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE]+$/
10CJK 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]+$/
11Decimal number/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[e|E][+-]?\d+)?$/
12Decimal fraction/^[+-]?\d*\.\d+$/
13Email/^[-!#$%&'*+\/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])*)+$/
14Domain/^((https?):\/\/)?[^\s].[^\s]*$/i
15IPv4/^(?: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)$/
16QQ/^[1-9]\d{4,}$/
17Chinese phone number/^1\d{10}$/
18Chinese telephone number/^\d{7,8}$/
19Chinese identity number/^(\d{15}|\d{18})$/
20Hex Color/^#([0-9A-F]{3}|[0-9A-F]{6})$/i
21RGB/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/
22RGBA/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*0?\.?\d+\s*\)$/
23HSL/^hsl\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/
24HSLA/^hsla\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*0?\.?\d+\s*\)$/