/Mark the next character as a special character, a literal character, a back reference, or an octal escape character.
^ Matches the start position of the input string. If the multiline attribute of the Regexp object is set, ^ matches the position after '/N' or'/R.
$ Matches the end position of the input string. If the multiline attribute of the Regexp object is set, $ also matches the location before '/N' or'/R.
* Matches the previous subexpression zero or multiple times.
+ Match the previous subexpression once or multiple times. + Is equivalent to {1 ,}.
? Match the previous subexpression zero or one time .? It is equivalent to {0, 1 }.
{N} n is a non-negative integer that matches the specified n times.
{N ,}n is a non-negative integer and matches at least N times.
Both {n, m} m and n are non-negative integers, where n <= m. Match at least N times and at most m times. There must be no space between a comma and two numbers.
? When this character is followed by any other delimiter (*, + ,?, The matching mode after {n}, {n ,}, {n, m}) is not greedy. The non-Greedy mode matches as few searched strings as possible, while the default greedy mode matches as many searched strings as possible.
. Match any single character except "/N. To match any character including '/N', use a pattern like' [./N.
(Pattern) matches pattern and obtains this match.
(? : Pattern) matches pattern but does not get the matching result. That is to say, this is a non-get match and is not stored for future use.
(? = Pattern) Forward pre-query: matches the search string at the beginning of any string that matches pattern. This is a non-get match, that is, the match does not need to be obtained for future use.
(?! Pattern) negative pre-query, and (? = Pattern ).
X | y matches X or Y.
[Xyz] Character Set combination.
[^ XYZ] combination of negative character sets.
[A-Z] character range, matching any character in the specified range.
[^ A-Z] The negative character range matches any character that is not within the specified range.
/B matches a word boundary, that is, the position between a word and a space.
/B matches non-word boundaries.
/CX matches the control characters specified by X.
/D matches a numeric character. It is equivalent to [0-9].
/D matches a non-numeric character. It is equivalent to [^ 0-9].
/F matches a break. It is equivalent to/x0c and/Cl.
/N matches a linefeed. It is equivalent to/x0a and/CJ.
/R matches a carriage return. It is equivalent to/x0d and/cm.
/S matches any blank characters, including spaces, tabs, and page breaks. It is equivalent to [/f/n/R/T/V].
/S matches any non-blank characters. It is equivalent to [^/f/n/R/T/V].
/T matches a tab. It is equivalent to/x09 and/CI.
/V matches a vertical tab. It is equivalent to/x0b and/ck.
/W matches any word characters that contain underscores. It is equivalent to [A-Za-z0-9 _].
/W matches any non-word characters. It is equivalent to [^ A-Za-z0-9 _].
/XN matches n, where N is the hexadecimal escape value. The hexadecimal escape value must be determined by the length of two numbers.
/Num matches num, where num is a positive integer. References to the obtained matching.
/N identifies an octal escape value or a backward reference. If at least N subexpressions are obtained before/n, n is a back reference. Otherwise, if n is an octal digit (0-7), n is an octal escape value.
/Nm identifies an octal escape value or a backward reference. If there are at least is preceded by at least nm obtained subexpressions before/nm, then nm is backward reference. If at least N records are obtained before/nm, n is a backward reference followed by text M. If none of the preceding conditions are met, if n and m are Octal numbers (0-7),/nm matches the octal escape value nm.
/NML if n is an octal digit (0-3) and M and l are octal digits (0-7), the octal escape value NML is matched. /UN matches n, where n is a Unicode character represented by four hexadecimal numbers.
The following is a common Regular Expression --
Verification number: ^ [0-9] * $
Verify the n-digit number: ^/d {n} $
Verify the number of at least N digits: ^/d {n,} $
Verify M-N digits: ^/d {m, n} $
Verify the number starting with zero or zero: ^ (0 | [1-9] [0-9] *) $
Verify the positive number of two decimal places: ^ [0-9] + (. [0-9] {2 })? $
Verify the positive number of 1-3 decimal places: ^ [0-9] + (. [0-9] {1, 3 })? $
Verify a non-zero positive integer: ^/+? [1-9] [0-9] * $
Verify a non-zero negative integer: ^/-[1-9] [0-9] * $
Verify non-negative integer (positive integer + 0) ^/d + $
Verify non-positive integer (negative integer + 0) ^ (-/d +) | (0 +) $
3 characters for verification: ^. {3} $
Verify a string consisting of 26 English letters: ^ [A-Za-Z] + $
Verify a string consisting of 26 uppercase letters: ^ [A-Z] + $
Verify a string consisting of 26 lower-case letters: ^ [A-Z] + $
Verify a string consisting of digits and 26 English letters: ^ [A-Za-z0-9] + $
Verify a string consisting of digits, 26 English letters, or underscores: ^/W + $
Verify User Password: ^ [A-Za-Z]/W {5, 17} $ the correct format is: it must start with a letter and be between 6 and 18 characters. It can only contain characters, numbers, and underscores.
Check whether ^ % & ',; =? $/"And other characters: [^ % & ',; =? $/X22] +
Verify Chinese characters: ^ [/u4e00-/u9fa5], {0,} $
Verify email address: ^/W + [-+.] /W +) * @/W + ([-.] /W + )*/. /W + ([-.] /W +) * $
Verify interneturl: ^ http: // ([/W-] +/.) + [/W-] + (/[/W -./? % & =] *)? $; ^ [A-Za-Z] +: // (W + (-W +) *) (. (W + (-W + )*))*(? S *)? $
Verification phone number: ^ (/d {3, 4}/) |/d {3, 4 }-)? /D {7, 8} $: -- the correct format is: XXXX-XXXXXXX, XXXX-XXXXXXXX, XXX-XXXXXXX, XXX-XXXXXXXX, xxxxxxx, XXXXXXXX.
ID number for verification (15 or 18 digits): ^/d {15} |/d {} 18 $
12 months of verification: ^ (0? [1-9] | 1 [0-2]) $ the correct format is: "01"-"09" and "1" "12"
31 days of verification for a month: ^ (0? [1-9]) | (1 | 2) [0-9]) | 30 | 31) $ the correct format is: 01, 09, 1, 31.
Integer: ^ -? /D + $
Non-negative floating point number (Positive floating point number + 0): ^/d + (/./d + )? $
Positive floating point number ^ ([0-9] + /. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] */. [0-9] +) | ([0-9] * [1-9] [0-9] *) $
Non-Positive floating point number (negative floating point number + 0) ^ (-/d + (/./d + )?) | (0 + (/. 0 + )?)) $
Negative floating point number ^ (-([0-9] + /. [0-9] * [1-9] [0-9] *) | ([0-9] * [1-9] [0-9] */. [0-9] +) | ([0-9] * [1-9] [0-9] *) $
Floating Point Number ^ (-? /D +) (/./d + )? $