Regular charactersdescribe
\Marks the next character as a special character, or a literal character, or a backreference, or an octal escape character. For example,"n"match character"n"。"\n"Match a newline character. Serial"\\"match"\"and"\("then matches"("。
^Matches the beginning of the input string. If the Multiline property of the RegExp object is set, ^ also matches "\n"or"\r"The position after.
$Matches the end of the input string. If the Multiline property of the RegExp object is set, $ also matches "\n"or"\r"Previous location.
*Matches the preceding subexpression zero or more times. For example, zo* matches "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 subexpression zero or one time. For example,"do(es)?"can match"does"or"does"Intermediate"do".? Equivalent to {0,1}.
{n}nis a non-negative integer. match confirmednSecond-rate. For example,"o{2}"cannot match"Bob"Intermediate"o", but can match"food"The two o's in.
{n,}nis a non-negative integer. match at leastnSecond-rate. For example,"o{2,}"cannot match"Bob"Intermediate"o", but can match"foooood"All the o's in."o{1,}"Equivalent to"o+"。"o{0,}"is equivalent to"o*"。
{n,m}mandnare all non-negative integers, wheren<=m. least matchntimes and matches at mostmSecond-rate. For example,&quot;o{1,3}&quot;will match&quot;fooooood&quot;The first three o's in.&quot;o{0,1}&quot;Equivalent to&quot;o?&quot;. Please note that there cannot be a space between the comma and the two numbers.
?When this character is immediately followed by any other limiter (*, +,?, {n},{n,},{n,m}), the matching pattern is non-greedy. 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 &quot;oooo","o+?&quot;will match a single&quot;o&quot;,and&quot;o+&quot;will match all&quot;o"。
.Match except &quot;\nAny single character other than &quot;. To match includes &quot;\nAny characters including &quot;, please use something like&quot;(.|\n)&quot;mode.
(pattern)Match pattern and get this match. The obtained matches can be obtained from the generated Matches collection, using the SubMatches collection in VBScript and the $0...$9 attributes in JScript. To match parentheses characters, use &quot;\(&quot;or&quot;\)"。
(?:pattern)Matches the pattern but does not obtain the matching result, which means that this is a non-acquisition match and is not stored for later use. This is done using the or character &quot;(|)&quot;Useful to combine parts of a pattern. For example&quot;industr(?:y|ies)&quot;It's just a comparison&quot;industry|industries&quot;A simpler expression.
(?=pattern)Forward positive lookup, matches the search string at the beginning of any string matching pattern. This is a non-fetch match, that is, the match does not need to be fetched for later use. For example,&quot;Windows(?=95|98|NT|2000)&quot;can match&quot;Windows2000&quot;Intermediate&quot;Windows&quot;, but cannot match&quot;Windows3.1&quot;Intermediate&quot;Windows&quot;. Prefetch does not consume characters, that is, after a match occurs, the search for the next match starts immediately after the last match, rather than starting after the characters containing the prefetch.
(?!pattern)Forward negative lookup, matches the search string at the beginning of any string that does not match the pattern. This is a non-fetch match, that is, the match does not need to be fetched for later use. For example&quot;Windows(?!95|98|NT|2000)&quot;can match&quot;Windows3.1&quot;Intermediate&quot;Windows&quot;, but cannot match&quot;Windows2000&quot;Intermediate&quot;Windows&quot;. Prefetch does not consume characters, that is, after a match occurs, the search for the next match starts immediately after the last match, rather than starting after the characters containing the prefetch
(?<=pattern)Reverse positive pre-checking is similar to forward positive pre-checking, but in the opposite direction. For example,&quot;(?<=95|98|NT|2000)Windows&quot;can match&quot;2000Windows&quot;Intermediate&quot;Windows&quot;, but cannot match&quot;3.1Windows&quot;Intermediate&quot;Windows"。
(?Reverse negative pre-checking is similar to forward negative pre-checking, but in the opposite direction. For example&quot;(?&quot;can match&quot;3.1Windows&quot;Intermediate&quot;Windows&quot;, but cannot match&quot;2000Windows&quot;Intermediate&quot;Windows"。
x|yMatch x or y. For example,&quot;z|food&quot;can match&quot;z&quot;or&quot;food"。"(z|f)ood&quot;then matches&quot;zood&quot;or&quot;food"。
[xyz]Character collection. Matches any one of the characters contained. For example,&quot;[abc]&quot;can match&quot;plain&quot;Intermediate&quot;a"。
[^xyz]A collection of negative characters. Matches any character not included. For example,&quot;[^abc]&quot;can match&quot;plain&quot;Intermediate&quot;p"。
[a-z]Character range. Matches any character within the specified range. For example,&quot;[a-z]&quot;can match&quot;a&quot;arrive&quot;z&quot; Any lowercase alphabetic character within the range.
[^a-z]Negative character range. Matches any character not within the specified range. For example,&quot;[^a-z]&quot;can match anything that is not&quot;a&quot;arrive&quot;z&quot;Any character within the range.
\bMatches a word boundary, which is the position between a word and a space. For example,&quot;er\b&quot;can match&quot;never&quot;Intermediate&quot;er&quot;, but cannot match&quot;verb&quot;Intermediate&quot;er"。
\BMatch non-word boundaries. &quot;er\B&quot;can match&quot;verb&quot;Intermediate&quot;er&quot;, but cannot match&quot;never&quot;Intermediate&quot;er"。
\cxMatches the control character specified by x. For example, \cM matches a Control-M or carriage return character. The value of x must be one of AZ or az. Otherwise, treat c as a literal &quot;c&quot;character.
\dMatches a numeric character. Equivalent to [0-9].
\DMatches a non-numeric character. Equivalent to [^0-9].
\fMatches a form feed character. Equivalent to \x0c and \cL.
\nMatches a newline character. Equivalent to \x0a and \cJ.
\rMatches a carriage return character. Equivalent to \x0d and \cM.
\sMatches any whitespace character, including spaces, tabs, form feeds, and so on. Equivalent to [ \f\n\r\t\v].
\SMatches any non-whitespace character. Equivalent to [^ \f\n\r\t\v].
\tMatches a tab character. Equivalent to \x09 and \cI.
\vMatches a vertical tab character. Equivalent to \x0b and \cK.
\wMatches any word character including an underscore. Equivalent to&quot;[A-Za-z0-9_]"。
\WMatches any non-word character. Equivalent to&quot;[^A-Za-z0-9_]"。
\xnmatchn,innIs the hexadecimal escape value. The hexadecimal escape value must be exactly two digits long. For example,&quot;\x41&quot;match&quot;A"。"\x041&quot;is equivalent to&quot;\x04&1&quot;. ASCII encoding can be used in regular expressions.
\nummatchnum,innumis a positive integer. A reference to the match obtained. For example,&quot;(.)\1&quot;matches two consecutive identical characters.
\nIdentifies an octal escape value or a backreference. if\nbefore at leastnobtained subexpressions, thennfor backward reference. Otherwise, ifnis an octal number (0-7), thennIs an octal escape value.
\nmIdentifies an octal escape value or a backreference. if\nmThere were at leastnmobtain subexpressions, thennmfor backward reference. if\nmThere were at leastnobtained, thennis followed by textmof backward references. If none of the previous conditions are met, ifnandmare all octal numbers (0-7), then\nmwill match octal escape valuesnm
\nmlifnis an octal number (0-3), andm and lare all octal numbers (0-7), then match the octal escape valuenml。
\unmatchn,innis 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}$/
Password 2(?=^.{8,}$)(?=.*\d)(?=.*\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\n).*$(Composed 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})$/
/^[az\d]+(\.[az\d]+)*@([\da-z](-[\da-z])?)+(\.{1,2}[az] +)+$/or\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
URL/^(https?:\/\/)?([\da-z\.-]+)\.([az\.]{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/^&lt;([az]+)([^&lt;]+)*(?:&gt;(.*)&lt;\/\1&gt;|\s+\/&gt;)$/or<(.*)(.*)>.*<\/\1>|<(.*) \/>
Remove code\\comments(?
Match double-byte characters (including Chinese characters)[^\x00-\xff]
Kanji (characters)[\u4e00-\u9fa5]
Chinese character range 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 format)((1|0?)[0-9]|2[0-3]):([0-5][0-9])
Mainland China landline phone number(\d{4}-|\d{3}-)?(\d{8}|\d{7})
Mainland China mobile phone number1\d{10}
Mainland China postal code[1-9]\d{5}
Mainland China ID 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+
decimal(-?\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 leading and trailing whitespace characters^\s*|\s*$
Commonly used by editors
The following are some replacements for special Chinese (editplus)
^[0-9].*\n
^[^th].*\n
^[Exercises].*\n
^[\s\S ]*\n
^[0-9]*\.
^[\s\S ]*\n
*]>
href="javascript:if\(confirm\('(.*?)'\)\)window\.location='(.*?)'"
.[^<>]*
[\s\S]*?

Regular expression syntax

Regular expression syntax is your frequently used regular expression cheat sheet, regular expression syntax query, commonly used regular expression syntax, basic regular expression syntax, subexpression syntax, regular expression modifiers, regular expression greedy mode, regular expressions Expression non-greedy mode achieves string control through a simple and fast method.

Language: English | 中文 | Русский | Español | Português | हिन्दी | தமிழ் | Deutsch | Français | عربي | 日本語 | 한국어
Your track:
Advertising area 1