regular characterdescription
\Mark the next character as a special character, or a literal character, or a backreference, or an octal escape. For example, "n" matches the character "n". "\n" matches a newline. Serial "\ " matches "\" and "\(" matches "(".
^Matches the beginning of the input string. If the Multiline property of the RegExp object is set, ^ also matches positions after "\n" or "\r".
$Match the end of the input string. If the Multiline property of the RegExp object is set, $ also matches the position before "\n" or "\r".
*Matches the preceding subexpression zero or more times. For example, zo* matches "z" and "zoo". * is equivalent to {0,}.
+Matches the preceding subexpression one or more times. For example, "zo+" matches "zo" and "zoo", but not "z" .+ is equivalent to {1,}.
?Matches the preceding subexpression zero or one time. For example, "do(es)?" matches "dodoes" or "does" >".? Equivalent to {0,1}.
{n}n is a non-negative integer. Matches certain n times. For example, "o{2}" does not match "o" in "Bob", but does match "food< The two o's in /code>".
{n,}{n,}n is a non-negative integer. Matches at least n times. For example, "o{2,}" does not match "o" in "Bob", but does match "foooood" "."o{1,}" is equivalent to "o+"."o{0,}" is equivalent to "o*".
{n,m}m and n are non-negative integers, where n<=m. Matches at least n times and matches at most m times. For example, "o{1,3}" would match the first three o's in "fooooood"."o{0,1}" is equivalent to "o?". Please note that there is no space between the comma and the two numbers.
?When the character immediately follows any other qualifier (*,+,?, {n}, {n,}, {n,m}), the matching pattern is non-greedy. The non-greedy mode matches as little of the searched string as possible, while the default greedy mode matches as much of the searched string as possible. For example, for the string "oooo", "o+?" would match a single "o", while "o+" code>" will match all "o".
.Matches except “\n". To match include "\n ", use a pattern like "(.|\n)".
(pattern)Match pattern and get this match. The retrieved matches can be obtained from the resulting Matches collection, using the SubMatches collection in VBScript and the $0…$9 properties in JScript. To match parentheses characters, use “\(" or "\)".
(?:pattern)Matches the pattern but does not get the matching result, which means that this is a non-acquiring match and is not stored for later use. This is useful when using the or character "(|)" to combine parts of a pattern. For example "industr(?:y|ies)" is a "industry|industries" Shorter expression.
(?=pattern)Forward positive pre-check, match the search string at the beginning of any string matching pattern. This is a non-acquisition match, that is, the match does not need to be acquired for later use. For example, "Windows(?=95|98|NT|2000)" matches "Windows" in "Windows2000", but Cannot match "Windows" in "Windows3.1". Lookahead does not consume characters, that is, after a match occurs, it starts immediately after the last match The search for the next match, negative lookahead, matches the lookup string at the beginning of any string that does not match pattern. This is a non-acquisition match, that is, the match does not need to be acquired for later use. For example "Windows( ?!95|98|NT|2000)" matches "Windows" in "Windows 3.1", but not "Windows" in "Windows 2000". The lookahead does not consume characters, that is, after a match occurs , the search for the next match starts immediately after the last match, not after the character containing the lookahead.
(?!pattern)Forward negative pre-check, match the search string at the beginning of any string that does not match pattern. This is a non-acquisition match, that is, the match does not need to be acquired for later use. For example, "Windows(?!95|98|NT|2000)" can match "Windows" in "Windows3.1", But it cannot match "Windows" in "Windows2000". The lookahead does not consume characters, that is, after a match occurs, the next match starts immediately after the last match. A matching search, Negative lookahead, match the search string at the beginning of any string that does not match pattern. This is a non-acquisition match, that is, the match does not need to be acquired for later use. For example, "Windows(?!95|98|NT|2000)" can match "Windows" in "Windows3.1", but not "Windows" in "Windows2000". Lookahead consumes no characters, that is, after a match occurs, the search for the next match begins immediately after the last match, not after the character containing the lookahead
(?<=pattern)Reverse affirmative pre-check, similar to forward affirmative pre-check, but in the opposite direction. For example, "(?<=95|98|NT|2000)Windows" matches "Windows" in "2000Windows" , but cannot match "Windows" in "3.1Windows".
(?<!pattern)Reverse negative pre-check, similar to forward negative pre-check, but in the opposite direction. For example, "(?<!95|98|NT|2000)Windows" can match "Windows" in "3.1Windows" , but does not match "Windows" in "2000Windows".
x|yMatches x or y. For example, “z|food" matches "z" or "food"."(z|f)ood< /code>" matches "zood" or "food".
[xyz]Character set. Matches any one of the included characters. For example, "[abc]" matches "a" in "plain".
[^xyz]Negative character set. Matches any character not included. For example, “[^abc]" matches "p" in "plain".
[a-z]Character range. Matches any character in the specified range. For example, “[a-z]" matches any lowercase alphabetic character in the range "a" to "z".
[^a-z]Negative character range. Matches any arbitrary character not in the specified range. For example, "[^a-z]" matches any character not in the range "a" to "z".
\bMatches a word boundary, that is, the position between a word and a space. For example, "er\b" matches "er" in "never", but not "verb" "er" in code>".
\BMatches non-word boundaries. “er\B" matches "er" in "verb", but not "never" "er" in ".
\cxMatches the control character specified by x. For example, \cM matches a Control-M or carriage return. The value of x must be one of A-Z or a-z. Otherwise, treat c as a literal "c" character.
\dMatches a digit character. Equivalent to [0-9].
\DMatches a non-numeric character. Equivalent to [^0-9].
\fMatches a form feed. Equivalent to \x0c and \cL.
\nMatches a newline. Equivalent to \x0a and \cJ.
\rMatches a carriage return. Equivalent to \x0d and \cM.
\sMatches any whitespace character, including spaces, tabs, form feeds, etc. Equivalent to [ \f\n\r\t\v].
\SMatches any non-whitespace character. Equivalent to [^ \f\n\r\t\v].
\tMatches a tab. Equivalent to \x09 and \cI.
\vMatches a vertical tab. Equivalent to \x0b and \cK.
\wMatches any word character including underscore. Equivalent to “[A-Za-z0-9_]".
\WMatches any non-word character. Equivalent to “[^A-Za-z0-9_]".
\xnMatches n, where n is a hexadecimal escape value. The hexadecimal escape value must be a certain two digits long. For example, "\x41" matches "A". "\x041" is equivalent to "\x04&1< /code>". ASCII encoding can be used in regular expressions..
\numMatches num, where num is a positive integer. A reference to the fetched match. For example, "(.)\1" matches two consecutive identical characters.
\nIdentifies an octal escape value or a backreference. If \nbefore at least n obtained subexpressions, then n is a backreference. Otherwise, if n is an octal number (0-7), then n is an octal escape value.
\nmIdentifies an octal escape value or a backreference. If \nm is preceded by at least nm get subexpressions, then nm is a backreference. If \nm is preceded by at least n is obtained, then n is one followed by the text m. If none of the preceding conditions are met, if n and m are all octal numbers (0-7), then \nm Will match the octal escape value nm.
\nmlIf n is an octal number (0-3), and m and l are octal numbers (0-7), then match the octal escape value nml.
\unMatches n, where n 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/uppercase letters/lowercase letters/punctuation marks, all four must be present, more than 8 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 tag/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/ or <(.*)(.*)>.*<\/\1>|<(.*) \/>
delete code\comment(?<!http:|\S)//.*$
match double-byte characters (including Chinese characters)[^\x00-\xff]
Chinese characters (characters)[\u4e00-\u9fa5]
The range of Chinese characters in Unicode encoding/^[\u2E80-\u9FFF]+$/
Chinese and full-width punctuation marks (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 clock)((1|0?)[0-9]|2[0-3]):([0-5][0-9])
Mainland China fixed phone number(\d{4}-|\d{3}-)?(\d{8}|\d{7})
Mainland Chinamobile number1\d{10}
Mainland ChinaPostcode[1-9]\d{5}
Mainland ChinaID number(15-bit or 18-bit)\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+
decimal(-?\d+)(\.\d+)?
blank row\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
matchBlank spacecharacter^\s*|\s*$
Edit commonly used
The following are some substitutions for special Chinese(editplus)
^[0-9].*\n
^[^第].*\n
^[习题].*\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 your common regular expression quick reference table, regular expression syntax query, common regular expression syntax, regular expression basic syntax, subexpression syntax, regular expression modifiers, regular expressions Expression greedy mode, regular expression non-greedy mode, achieves control of strings through a simple and fast method.

Your visited history:

Friend Link: 沐杉软件