Regular characters Description
\ Marks the next character as a special character, or a literal character, or a backward quote, or an octal escape. For example, "n " matches the character "n"。"\n " matches a newline character. Serial"\\ "matches "\ " and "\( "matches"("。
^ matches the start of the input string. If the Multiline property of the RegExp object is set, ^ also matches "\n " or "\r " followed by a position.
$ matches the end position of the input string. If the Multiline property of the RegExp object is set, $ also matches "\n " or "\r " before the position.
* Matches the preceding sub-expression zero or more times. For example, zo* can match "z " as well as "zoo ". * is equivalent to {0,}.
+ Matches the preceding subexpression one or more times. For example, "zo+ " can match "zo " as well as "zoo ", but cannot match "z ". + is equivalent to {1,}.
? Matches the preceding sub-expression zero or one time. For example, "do(es)? " can match "does " or "does " in "do ".? is equivalent to {0,1}.
{n}n is a non-negative integer. The match is determinedn times. For example, "o{2} " cannot match "Bob " in "o ", but can match both o's in "food " in both o's.
{n,}n is a non-negative integer. Match at leastn times. For example, "o{2,} " cannot match "Bob " in "o ", but can match all o's in "foooood " for all o's in "."o{1,} "is equivalent to "o+"。"o{0,} "is then equivalent to "o*"。
{n,m}m andn are all non-negative integers, wheren<=m . Match at leastn times and at mostm times. For example, "o{1,3} " would match the first three o's in "fooooood " for the first three o's in "o{0,1} " is equivalent to "o? ". Note that there can be no space between a comma and two numbers.
? When this character is immediately followed by any of the other restriction characters (*,+,? , {n},{n,},{n,m }), the match pattern is non-greedy. The non-greedy pattern matches as few of the searched strings as possible, while the default greedy pattern matches as many of the searched strings as possible. For example, for the string "oooo","o+? " will match a single "o ", while "o+ " will match all "o"。
. matches any single string except "\n " for any single character except ". To match any character including "\n ", use a pattern like "(.|\n) " pattern.
(pattern) Matches pattern and gets this match. The obtained match can be obtained from the resulting Matches collection, using the SubMatches collection in VBScript or the $0...$9 attribute in JScript. To match parenthesis characters, use the "\( " or "\)"。
(?:pattern) matches the pattern but does not fetch the result, i.e. it is a non-fetchable match and is not stored for later use. This is done by using the or character "(|) " to combine parts of a pattern is useful. For example, "industr(?:y|ies) " is a shorter expression than "industry|industries " is a more abbreviated expression.
(?=pattern) Positive affirmative pre-check that matches the lookup string at the beginning of any string that matches the pattern. This is a non-fetch match, meaning that the match does not need to be fetched for later use. For example, "Windows(?=95|98|NT|2000) " can match "Windows2000 " in "Windows ", but cannot match "Windows3.1 " in "Windows ". Pre-checks do not consume characters, i.e., after a match occurs, the search for the next match begins immediately after the last match, not after the character containing the pre-check.
(?!pattern) Positive negative pre-checks match the lookup string at the beginning of any string that does not match the pattern. This is a non-fetch match, meaning that the match does not need to be fetched for later use. For example, "Windows(?!95|98|NT|2000) " can match "Windows3.1 " in "Windows ", but cannot match "Windows2000 " in "Windows ". Pre-checks do not consume characters, i.e., after a match occurs, the search for the next match begins immediately after the last match, not after the character that contains the pre-check
(?<=pattern) Reverse affirmative pre-checks are analogous to forward affirmative pre-checks, except in the opposite direction. For example, "(?<=95|98|NT|2000)Windows " can match "2000Windows " in "Windows ", but cannot match "3.1Windows " in "Windows"。
(?<!pattern) Reverse Negative Prefix, is analogous to Forward Negative Prefix, except in the opposite direction. For example, "(?<!95|98|NT|2000)Windows " can match "3.1Windows " in "Windows ", but cannot match "2000Windows " in "Windows"。
x|y matches x or y. For example, "z|food " can match "z " or "food"。"(z|f)ood " then matches "zood " or "food"。
[xyz] Character set. Matches any of the included characters. For example, "[abc] " can match "plain " in the "a"。
[^xyz] Negative character set. Matches any character not included. For example, "[^abc] " can match "plain " in the "p"。
[a-z] range of characters. Matches any character in the specified range. For example, "[a-z] " can match characters from "a " to "z " for any lowercase character in the range.
[^a-z] Negative Character Range. Matches any arbitrary character not in the specified range. For example, "[^a-z] " can match any character not in the range from "a " to "z " range of arbitrary characters.
\b Matches a word boundary, which means the position between the word and a space. For example, "er\b " can match "never " in "er ", but cannot match "verb " in "er"。
\B matches non-word boundaries. "er\B " can match "verb " in "er ", but cannot match "never " in "er"。
\cx Matches a control character specified by x. For example, \cM matches a Control-M or a carriage return character. x must have a value of one of A-Z or a-z. Otherwise, treat c as an original "c " character.
\d Matches a numeric character. Equivalent to [0-9].
\D Matches a non-numeric character. Equivalent to [^0-9].
\f Match a page break character. Equivalent to \x0c and \cL.
\n Matches a line feed character. Equivalent to \x0a and \cJ.
\r Match a carriage return character. Equivalent to \x0d and \cM.
\s Matches any whitespace character including spaces, tabs, page breaks, etc. Equivalent to [ \f\n\r\t\v].
\S Matches any non-whitespace character. Equivalent to [ ^ \f\n\r\t\v].
\t Matches a tab character. Equivalent to \x09 and \cI.
\v Match a vertical tab. Equivalent to \x0b and \cK.
\w Matches any word character that includes an underscore. Equivalent to "[A-Za-z0-9_]"。
\W Matches any non-word character. Equivalent to "[^A-Za-z0-9_]"。
\xn Matchesn wheren is the hexadecimal escape value. The hexadecimal escape value must be a definite two digits long. For example, "\x41 " matches "A"。"\x041 " would be equivalent to "\x04&1 ". ASCII encoding can be used in regular expressions. .
\num Matchnum , wherenum is a positive integer. A reference to the obtained match. For example, "(.)\1 " matches two consecutive identical characters.
\n Identifies an octal escape value or a backward reference. If \n is preceded by at leastn subexpressions are fetched, thenn is a backward reference. Otherwise, ifn is an octal number (0-7), thenn is an octal escape value.
\nm Identifies an octal escape value or a backward reference. If \nm is preceded by at leastnm a get sub-expression, thennm is a backward reference. If \nm was preceded by at leastn number of acquisitions, thenn is a backward reference followed by the textm of the backward reference. If none of the previous conditions are satisfied, ifn andm are both octal numbers (0-7), then \nm will match the octal escape valuenm
\nml Ifn is an octal number (0-3), and m and l are both octal numbers (0-7), then match octal escape valuenml。
\un matchesn wheren is a Unicode character represented by four hexadecimal digits. For example, \u00A9 matches the copyright symbol (©).
Username/^[a-z0-9_-]{3,16}$/
Password/^[a-z0-9_-]{6,18}$/
Password2(?=^.{8,}$)(?=.*\d)(?=.*\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\n).*$ (consists of numbers/upper case letters/lower case letters/punctuation marks, all four must be present, 8 or more digits)
Hexadecimal value/^#?([a-f0-9]{6}|[a-f0-9]{3})$/
E-Mail/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
/^[a-z\d]+(\. [a-z\d]+)*@([\da-z](-[\da-z])?) +(\. {1,2}[a-z]+)+$/ or\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
URL /^(https?:\/\/)? ([\da-z\. -]+)\. ([a-z\.] {2,6})([\/\w \...-]*)*\/? -]*)*\/? $/ or[a-zA-z]+://[^\s]*
IP address/((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)/
/^(? :(? :25[0-5]|2[0-4][0-9]|[01]? [0-9][0-9]?) \.) {3}(? :25[0-5]|2[0-4][0-9]|[01]? [0-9][0-9]?) $/ or((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)
HTML tags /^<([a-z]+)([^<]+)*(? :>(. *)<\/\1>|\s+\/>)$/ or<(.*)(.*)>.*<\/\1>|<(.*) \/>
Remove code \\\ comments(?<!http:|\S)//.*$
Match double-byte characters (including kanji)[^\x00-\xff]
Kanji (characters)[\u4e00-\u9fa5]
Range of Chinese characters in Unicode code/^[\u2E80-\u9FFF]+$/
Chinese and full-width punctuation (characters)[\u3000-\u301e\ufe10-\ufe19\ufe30-\ufe44\ufe50-\ufe6b\uff01-\uffee]
Date(year-month-day)(\d{4}|\d{2})-((0?([1-9]))|(1[1|2]))-((0?[1-9])|([12]([1-9]))|(3[0|1]))
Date (month/day/year)((0?[1-9]{1})|(1[1|2]))/(0?[1-9]|([12][1-9])|(3[0|1]))/(\d{4}|\d{2})
Time (hour:minute, 24-hour system)((1|0?)[0-9]|2[0-3]):([0-5][0-9])
Mainland China Fixed Phone Number(\d{4}-|\d{3}-)?(\d{8}|\d{7})
Cell phone number in mainland China1\d{10}
China Postal Code[1-9]\d{5}
China ID Card Number (15 or 18 digits)\d{15}(\d\d[0-9xX])?
Non-negative integer (positive integer or zero)\d+
Positive integer[0-9]*[1-9][0-9]*
Negative integer-[0-9]*[1-9][0-9]*
Integer-?\d+
Fractional(-?\d+)(\.\d+)?
Blank lines \n\s*\r or \n\n(editplus) or ^[\s\S ]*\n
QQ number[1-9]\d{4,}
Words that do not contain abc\b((?!abc)\w)+\b
Match first and last blank characters^\s*|\s*$
Commonly used by editors
Here are some substitutions for special Chinese characters (editplus)
^[0-9].*\n
^[^th]. *\^[^th].
^[Exercise]. *\n
^[\s\S ]*\n
^[0-9]*\.
^[\s\S ]*\n
<p[^<>*]>
href="javascript:if\(confirm\('(.*?)'\)\)window\.location='(.*?)'"
<span style=".[^"]*rgb\(255,255,255\)">.[^<>]*</span>
<DIV class=xs0>[\s\S]*?</DIV>

Regular expression syntax

Regular expression syntax for you commonly used regular expression quick lookup table, regular expression syntax query, commonly used regular expression syntax, regular expression basic syntax, sub-expression syntax, regular expression modifier, regular expression greedy mode, regular expression non-greedy mode, through a simple and fast way to achieve the control of the string.

Access logs: