illustrateregular expression
URL[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?)
Email address\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
QQ number[1-9]\d{4,}
HTML markup (containing content or self-closing)<(.*)(.*)>.*<\/\1>|<(.*) \/>
Password (composed of numbers/uppercase letters/lowercase letters/punctuation marks, all four must be present, more than 8 characters)(?=^.{8,}$)(?=.*\d)(?=.*\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\n).*$
Date (year-month-day)(\d{4}|\d{2})-((1[0-2])|(0?[1-9]))-(([12][0-9])|(3[01])|(0?[1-9]))
Date (month/day/year)((1[0-2])|(0?[1-9]))/(([12][0-9])|(3[01])|(0?[1-9]))/(\d{4}|\d{2})
Time (hour:minute, 24-hour format)((1|0?)[0-9]|2[0-3]):([0-5][0-9])
Kanji (characters)[\u4e00-\u9fa5]
Chinese and full-width punctuation marks (characters)[\u3000-\u301e\ufe10-\ufe19\ufe30-\ufe44\ufe50-\ufe6b\uff01-\uffee]
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+)?
Words that do not contain abc\b((?!abc)\w)+\b
illustrateregular expression
username/^[a-z0-9_-]{3,16}$/
password/^[a-z0-9_-]{6,18}$/
hexadecimal value/^#?([a-f0-9]{6}|[a-f0-9]{3})$/
E-mail/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
URL/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
IP address/^(?:(?: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]?)$/
HTML tag/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/
Chinese character range in Unicode encoding/^[u4e00-u9fa5],{0,}$/
Regular expression to match Chinese characters[\u4e00-\u9fa5]
Comment: Matching Chinese is really a headache. With this expression, it will be easier.
Match double-byte characters (including Chinese characters)[^\x00-\xff]
Comment: Can be used to calculate the length of a string (a double-byte character counts as 2, and an ASCII character counts as 1)
Regular expression to match blank lines\n\s*\r
Comment: Can be used to delete blank lines
Regular expression to match HTML tags<(\S*?)[^>]*>.*?|<.*?/>
Comment: The version circulating on the Internet is too bad. The above one can only match part of it, and it is still powerless for complex nested tags.
Regular expression to match leading and trailing whitespace characters^\s*|\s*$
Comment: It can be used to delete whitespace characters (including spaces, tabs, form feeds, etc.) at the beginning and end of the line. It is a very useful expression.
Regular expression to match email addresses\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
Comment: Very useful for form validation
Regular expression to match URL[a-zA-z]+://[^\s]*
Comment: The version circulating on the Internet has very limited functions. The above one can basically meet the needs.
Whether the matching account is legal (starting with a letter, 5-16 bytes allowed, alphanumeric underscores allowed)^[a-zA-Z][a-zA-Z0-9_]{4,15}$
Comment: Very useful for form validation
Match domestic phone numbers\d{3}-\d{8}|\d{4}-\d{7}
Comment: Matching format such as 0511-4405222 or 021-87888822
Match Tencent QQ number[1-9][0-9]{4,}
Comment: Tencent QQ account starts from 10000
Match mainland China postal code[1-9]\d{5}(?!\d)
Comment: Postal codes in mainland China are 6 digits
Match ID card\d{15}|\d{18}
Comment: Mainland China’s ID card has 15 or 18 digits
match ip address\d+\.\d+\.\d+\.\d+
Comment: Useful when extracting IP address
Match specific numbers:
^[1-9]\d*$//Match positive integers
^-[1-9]\d*$//match negative integers
^-?[1-9]\d*$//match integers
^[1-9]\d*|0$//Match non-negative integers (positive integers + 0)
^-[1-9]\d*|0$//Match non-positive integers (negative integers + 0)
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$//Match positive floating point numbers
^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$//Match negative floating point numbers
^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$//Match floating point numbers
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$//Match non-negative floating point numbers (positive floating point numbers + 0)
^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$//Match non-positive floating point numbers (negative floating point numbers + 0)
Comment: Useful when processing large amounts of data, please pay attention to corrections when applying it.
Match specific string
^[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
characterdescribe
\Marks the next character as a special character, or a literal character, or a backreference, or an octal escape character. For example, &quot;n&quot; matches the character &quot;n&quot;. &quot;\n&quot; matches a newline character. The sequence &quot;\\&quot; matches &quot;\&quot; and &quot;\(&quot; matches &quot;(&quot;.
^Matches the beginning of the input string. If the Multiline property of the RegExp object is set, ^ also matches the position after &quot;\n&quot; or &quot;\r&quot;.
$Matches the end of the input string. If the Multiline property of the RegExp object is set, $ also matches the position before &quot;\n&quot; or &quot;\r&quot;.
*Matches the preceding subexpression zero or more times. For example, zo* matches &quot;z&quot; and &quot;zoo&quot;. *Equivalent to {0,}.
+Matches the preceding subexpression one or more times. For example, &quot;zo+&quot; matches &quot;zo&quot; and &quot;zoo&quot;, but not &quot;z&quot;. + is equivalent to {1,}.
?Matches the preceding subexpression zero or one time. For example, &quot;do(es)?&quot; would match the &quot;do&quot; in &quot;do&quot; or &quot;does&quot;. ? Equivalent to {0,1}.
{n}n is a nonnegative integer. Match determined n times. For example, &quot;o{2}&quot; cannot match the &quot;o&quot; in &quot;Bob&quot;, but it can match the two o's in &quot;food&quot;.
{n,}n is a nonnegative integer. Match at least n times. For example, &quot;o{2,}&quot; cannot match the &quot;o&quot; in &quot;Bob&quot;, but it can match all o's in &quot;foooood&quot;. &quot;o{1,}&quot; is equivalent to &quot;o+&quot;. &quot;o{0,}&quot; is equivalent to &quot;o*&quot;.
{n,m}Both m and n are non-negative integers, where n&lt;=m. Match at least n times and at most m times. For example, &quot;o{1,3}&quot; will match the first three o's in &quot;fooooood&quot;. &quot;o{0,1}&quot; is equivalent to &quot;o?&quot;. Please note that there cannot be a space between the comma and the two numbers.
?When this character immediately follows any of the other qualifiers (*,+,?, {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&quot;, &quot;o+?&quot; will match a single &quot;o&quot;, while &quot;o+&quot; will match all &quot;o&quot;s.
.Matches any single character except &quot;\n&quot;. To match any character including &quot;\n&quot;, use a pattern like &quot;[.\n]&quot;.
(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;\)&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 useful when combining parts of a pattern using the or character &quot;(|)&quot;. For example, &quot;industr(?:y|ies)&quot; is a simpler expression than &quot;industry|industries&quot;.
(?=pattern)Forward 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;Windows&quot; in &quot;Windows2000&quot;, but cannot match &quot;Windows&quot; in &quot;Windows3.1&quot;. Prefetching does not consume characters, that is, after a match occurs, the search for the next match begins immediately after the last match, rather than starting after the character containing the prefetch.
(?!pattern)Negative lookahead, 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;Windows&quot; in &quot;Windows3.1&quot;, but cannot match &quot;Windows&quot; in &quot;Windows2000&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 character containing the prefetch
x|yMatch x or y. For example, &quot;z|food&quot; matches &quot;z&quot; or &quot;food&quot;. &quot;(z|f)ood&quot; matches &quot;zood&quot; or &quot;food&quot;.
[xyz]Character collection. Matches any one of the characters contained. For example, &quot;[abc]&quot; would match the &quot;a&quot; in &quot;plain&quot;.
[^xyz]A collection of negative characters. Matches any character not included. For example, &quot;[^abc]&quot; would match the &quot;p&quot; in &quot;plain&quot;.
[a-z]Character range. Matches any character within the specified range. For example, &quot;[az]&quot; matches any lowercase alphabetic character in the range &quot;a&quot; through &quot;z&quot;.
[^a-z]Negative character range. Matches any character not within the specified range. For example, &quot;[^az]&quot; matches any character that is not in the range &quot;a&quot; through &quot;z&quot;.
\bMatches a word boundary, which is the position between a word and a space. For example, &quot;er\b&quot; matches the &quot;er&quot; in &quot;never&quot; but not the &quot;er&quot; in &quot;verb&quot;.
\BMatch non-word boundaries. &quot;er\B&quot; can match the &quot;er&quot; in &quot;verb&quot;, but not the &quot;er&quot; in &quot;never&quot;.
\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_]&quot;.
\WMatches any non-word character. Equivalent to &quot;[^A-Za-z0-9_]&quot;.
\xnMatches n, where n is the hexadecimal escape value. The hexadecimal escape value must be exactly two digits long. For example, &quot;\x41&quot; matches &quot;A&quot;. &quot;\x041&quot; is equivalent to &quot;\x04&amp;1&quot;. ASCII encoding can be used in regular expressions. .
\numMatches num, where num is 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 \n is preceded by at least n fetched subexpressions, n is a backward reference. 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 there are at least nm get subexpressions before \nm, nm is a backward reference. If \nm is preceded by at least n obtains, then n is a backward reference followed by the literal m. If none of the previous conditions are met, and if n and m are both 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 both octal digits (0-7), then the octal escape value nml is matched.
\unMatches n, where n is a Unicode character represented by four hexadecimal digits. For example, \u00A9 matches the copyright symbol (?).
Language: English | 中文 | Русский | Español | Português | हिन्दी | தமிழ் | Deutsch | Français | عربي | 日本語 | 한국어
Your track:
Advertising area 1