DescriptionRegular 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 Tag (with or without content)<(.*)(.*)>.*<\/\1>|<(.*) \/>
Password (composed of digits, uppercase letters, lowercase letters, punctuation marks, at least 8 characters)(?=^.{8,}$)(?=.*\d)(?=.*\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\n).*$
Date (YYYY-MM-DD)(\d{4}|\d{2})-((1[0-2])|(0?[1-9]))-(([12][0-9])|(3[01])|(0?[1-9]))
Date (MM/DD/YYYY)((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])
Chinese Characters[\u4e00-\u9fa5]
Chinese and Full-width Punctuation Characters[\u3000-\u301e\ufe10-\ufe19\ufe30-\ufe44\ufe50-\ufe6b\uff01-\uffee]
Chinese Mainland Landline Phone Number(\d{4}-|\d{3}-)?(\d{8}|\d{7})
Chinese Mainland Mobile Phone Number1\d{10}
Chinese Mainland Postal Code[1-9]\d{5}
Chinese Mainland 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+)?
Word Not Containing 'abc'\b((?!abc)\w)+\b
DescriptionRegular Expression
Username/^[a-z0-9_-]{3,16}$/
Password/^[a-z0-9_-]{6,18}$/
Hexadecimal Value/^#?([a-f0-9]{6}|[a-f0-9]{3})$/
Email/^([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/^[u4e00-u9fa5],{0,}$/
Regex for Matching Chinese Characters[\u4e00-\u9fa5]
Note: Matching Chinese characters can be challenging, but this expression simplifies it.
Match Double-byte Characters (including Chinese)[^\x00-\xff]
Note: Can be used to calculate string length (double-byte characters count as 2, ASCII characters count as 1).
Regex to Match Blank Lines\n\s*\r
Note: Useful for removing blank lines.
Regex to Match HTML Tags<(\S*?)[^>]*>.*?</\1>|<.*?/>
Note: Many versions online are incorrect; this one only matches some cases and still struggles with complex nested tags.
Regex to Match Leading and Trailing Whitespace^\s*|\s*$
Note: Useful for trimming leading and trailing whitespace (spaces, tabs, page breaks, etc.).
Regex to Match Email Addresses\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
Note: Very useful for form validation.
Regex to Match URLs[a-zA-z]+://[^\s]*
Note: More versatile than many versions found online.
Regex to Check Validity of Account Names (starts with a letter, allows 5-16 characters, letters, numbers, and underscores)^[a-zA-Z][a-zA-Z0-9_]{4,15}$
Note: Very useful for form validation.
Regex to Match Domestic Telephone Numbers\d{3}-\d{8}|\d{4}-\d{7}
Note: Matches forms like 0511-4405222 or 021-87888822.
Regex to Match QQ Numbers[1-9][0-9]{4,}
Note: QQ numbers start from 10000.
Regex to Match Chinese Postal Codes[1-9]\d{5}(?!\d)
Note: Chinese postal codes are 6 digits long.
Regex to Match ID Numbers\d{15}|\d{18}
Note: Chinese ID numbers are either 15 or 18 digits.
Regex to Match IP Addresses\d+\.\d+\.\d+\.\d+
Note: Useful for extracting IP addresses.
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)
Note: Useful for processing large data sets; adjust as needed for specific use cases.
Match Specific Strings
^[A-Za-z]+$//Match Strings Composed of 26 English Letters
^[A-Z]+$//Match Strings Composed of 26 Uppercase English Letters
^[a-z]+$//Match Strings Composed of 26 Lowercase English Letters
^[A-Za-z0-9]+$//Match Strings Composed of Numbers and 26 English Letters
^\w+$//Match Strings Composed of Numbers, 26 English Letters, or Underscores
CharacterDescription
\Marks the next character as a special character, a literal, a backreference, or an octal escape. For example, "n" matches the character "n". "\n" matches a newline. The sequence "\\" matches "\" and "\(" matches "(".
^Matches the beginning of the input string. If the RegExp object's Multiline property is set, ^ also matches the position after "\n" or "\r".
$Matches the end of the input string. If the RegExp object's Multiline property is set, $ also matches the position before "\n" or "\r".
*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+" matches "zo" and "zoo" but not "z". + is equivalent to {1,}.
?Matches the preceding subexpression zero or one time. For example, "do(es)?" matches "do" or "does". ? is equivalent to {0,1}.
{n}n is a non-negative integer. Matches exactly n times. For example, "o{2}" does not match "Bob" but matches "food".
{n,}n is a non-negative integer. Matches at least n times. For example, "o{2,}" does not match "Bob" but matches all "o"s in "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 at most m times. For example, "o{1,3}" matches the first three "o"s in "fooooood". "o{0,1}" is equivalent to "o?".
?When this character immediately follows any other quantifier (*, +, ?, {n}, {n,}, {n,m}), the matching pattern is non-greedy. The non-greedy pattern matches as little of the searched string as possible, whereas the default greedy pattern matches as much of the searched string as possible. For example, for the string "oooo", "o+?" matches a single "o", while "o+" matches all "o"s.
.Matches any single character except "\n". To match any character including "\n", use a pattern like "[.\n]".
(pattern)Matches pattern and captures the match. The captured match can be obtained from the resulting Matches collection, using the SubMatches collection in VBScript or $0...$9 properties in JScript. To match a parenthesis character, use "\(“ or “\)”.
(?:pattern)Matches pattern but does not capture the match; this is a non-capturing match, and it is not stored for later use. This is useful when combining parts of a pattern with the "or" character (|). For example, “industr(?:y|ies)” is a shorter expression than “industry|industries”.
(?=pattern)A positive lookahead that matches the search string at any point where pattern begins. This is a non-capturing match, meaning the match is not stored for later use. For example, "Windows(?=95|98|NT|2000)" matches "Windows" in "Windows2000" but not "Windows" in "Windows3.1". Lookaheads do not consume characters, meaning that after one match is found, the search immediately begins again after the last match, rather than after the character containing the lookahead.
(?!pattern)A negative lookahead that matches the search string at any point where pattern does not begin. This is a non-capturing match, meaning the match is not stored for later use. For example, "Windows(?!95|98|NT|2000)" matches "Windows" in "Windows3.1" but not "Windows" in "Windows2000". Lookaheads do not consume characters, meaning that after one match is found, the search immediately begins again after the last match, rather than after the character containing the lookahead.
x|yMatches x or y. For example, "z|food" matches "z" or "food". "(z|f)ood" matches "zood" or "food".
[xyz]Character set. Matches any one of the contained characters. For example, “[abc]” matches “a” in “plain”.
[^xyz]Negated character set. Matches any character not contained. For example, “[abc]” matches “p” in “plain”.
[a-z]Character range. Matches any character within the specified range. For example, “[a-z]” matches any lowercase letter between “a” and “z”.
[^a-z]Negated character range. Matches any character not within the specified range. For example, “[a-z]” matches any character not between “a” and “z”.
\bMatches a word boundary, which is the position between a word and a space. For example, “er\b” matches “er” in “never”, but not “er” in “verb”.
\BMatches a non-word boundary. “er\B” matches “er” in “verb”, but not “er” in “never”.
\cxMatches the control character indicated by x. For example, \cM matches a Control-M or carriage return. x must be one of A-Z or a-z. Otherwise, c is treated as a literal “c” character.
\dMatches a digit character. Equivalent to [0-9].
\DMatches a non-digit 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 space, tab, form feed, 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. Hexadecimal escape values must be exactly two digits long. For example, “\x41” matches “A”. “\x041” is equivalent to “\x04&1”. Regular expressions can use ASCII encoding.
\numMatches num, where num is a positive integer. References the matched subexpression. For example, “(.)\1” matches two consecutive identical characters.
\nIdentifies an octal escape value or a backreference. If \n has at least n obtained subexpressions, n is a backreference. Otherwise, if n is an octal digit (0-7), it is an octal escape value.
\nmIdentifies an octal escape value or a backreference. If \nm has at least nm obtained subexpressions, nm is a backreference. If \nm has at least n obtained, n is a backreference followed by literal m. If none of these conditions are met, and both n and m are octal digits (0-7), \nm matches octal escape value nm.
\nmlIf n is an octal digit (0-3), and m and l are both octal digits (0-7), matches octal escape value nml.
\unMatches n, where n is a Unicode character represented by four hexadecimal digits. For example, \u00A9 matches the copyright symbol (©).
Your Footprints: