| 字符 |
描述 |
| ^\d+$ |
//Match non-negative integers (positive integers + 0) |
| //Match integers ^\d+(\.\d+)?$ |
//Match non-negative floating point numbers (positive floating
point numbers + 0)
|
|
^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$
|
//Match positive floating point numbers |
| ^((-\d+(\.\d+)?)|(0+(\.0+)?))$ |
//Match non-positive floating point numbers (negative floating
point numbers + 0)
|
|
^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$
|
//Match negative floating point numbers |
| ^(-?\d+)(\.\d+)?$ |
//Match floating point numbers |
| ^[A-Za-z]+$????????? |
//Match a string consisting of 26 English letters |
| ^[A-Z]+$ ??? |
//Match a string consisting of 26 uppercase English letters
|
| ^[a-z]+$ |
//Match a string consisting of 26 lowercase English letters
|
| ^[A-Za-z0-9]+$ |
//Match a string consisting of numbers and 26 English letters
|
| ^\w+$ |
//Match a string consisting of numbers, 26 English letters, or
underscores
|
| ^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$ |
//Match email address |
| ^[a-zA-z]+://match(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$ |
//match url |
| [\u4e00-\u9fa5] |
Regular expression to match Chinese characters |
| [^\x00-\xff] |
Match double-byte characters (including Chinese characters)
|
| \n[\s| ]*\r |
Regular expression to match empty lines |
| /<(.*)>.*<\/>|<(.*)\/>/ |
Regular expression to match HTML tags |
| (^\s*)|(\s*$) |
Regular expression matching leading and trailing spaces |
| \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* |
Regular expression to match email addresses |
| ^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$ |
Regular expression to match URL |
| ^[a-zA-Z][a-zA-Z0-9_]{4,15}$ |
Whether the matching account is legal (starting with a letter,
5-16 bytes allowed, alphanumeric underscores allowed)
|
| (\d{3}-|\d{4}-)?(\d{8}|\d{7})? |
Match domestic phone numbers |
| ^[1-9]*[1-9][0-9]*$ |
Match Tencent QQ account |