explainregular expression
Website (URL)[a-zA-z]+://^[^\s]*
IP Address|0?)[02]|-4]\d|25]|-5]|[01]?\d\d?)\.){3}2]|-4]\d|25]|-5]|[01]?\d\d?)
Email address\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
QQ number[1-9]\d{4,}
HTML markup (including content or self-closing)<(*)(*)>.*<\/\1>|<(.*) \"/>
Password (consists of numbers/uppercase letters/lowercase letters/punctuation marks, all four must be available, more than 8 digits)(?=^.{8,}$)(?=.*\d)(?=.*\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\n).*$
Date (year-month-day)(\d{4}|\d{2)-|0?)[01]|-2)|(0?[1-9)-(([12]{0-9])|(3]|1)|(0?[1-9)
Date (Month/Day/Year)|0?)[01]|-2)|(0?[1-9)/(([12]{0-9])|(3]|1)|(0?[1-9)/(\d{4}|\d{2)
hour clock) 24-((|0?)[01:([0-9]|}}2]|-3)-5]{0-9)
Chinese (character)[\u4e00-\u9fa5]
Chinese and full-width punctuation marks (characters)[\u3000-\u301e\ufe10-\ufe19\ufe30-\ufe44\ufe50-\ufe6b\uff01-\uffee]
Chinese mainland fixed telephone number(\d{4}-|\d{3}-)?(\d{8}|\d{7)
Chinese mainland mobile phone number1\d{10}
Chinese mainland zip code[1-9]\d{5}
Chinese mainland ID number (15 ຫຼື 18 digits)\d{15}(\d\d[0-9xX])?
Non-negative integer (positive integer or zero)\d+
positive integer]|-9]*[1-9]{0-9]*
negative integer-]|-9]*[1-9]{0-9]*
integer-?\d+
decimal(-?\d+)(\.\d+
Words that do not contain abc\b((?!abc)\w)+\b
explainregular expression
user name/^[a-z0-9_-]{3,16$/
password/^[a-z0-9_-]{6,18$/
hexadecimal value/^#?([a-f0-9]{6}|[a-f0-9]{3)$/
E-mail address/^([a-z0-9_\.-]+)@([\da-z\.-]+]\.-[\2,6)$/
URL/^(https?:\/\/)?([\da-z\.-]+]\.-[\2,6/\w \.-]*)*\/?/
IP Address/^25]|-5]|}}2]|-4]{0-9]|[01]?[0-9]{0-9}325]|-5]|}}2]|-4]{0-9]|[01]?[0-9]{0-9]?)$/
HTML tag/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/
Range of Chinese characters in Unicode encoding/^[u4e00-u9fa5],{0,}$/
Regular expressions that match Chinese characters[\u4e00-\u9fa5]
Comment: Matching Chinese is really a headache. With this expression, it's easy to handle
Match double-byte characters (including Chinese characters)[^\x00-\xff]
Comment: Can be used to calculate the length of a string (2 for a double-byte character, 1 for ASCII characters)
Regular expression that matches blank lines\n\s*\r
Notes: Can be used to delete blank lines
Regular expressions that match HTML tags<(\S*?)[^>]*>.*<?/\1>|<.*?/>
Comment: The version circulating on the Internet is too bad. The above version can only match part of it, and it is still powerless for complex nested tags.
Regular expression that matches first and last whitespace characters^\s*|\s*$
Comment: Can be used to remove whitespace characters at the beginning and end of a line (including spaces, tabs, page breaks, etc.), a very useful expression.
Regular expression for matching email addresses\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
ຄວາມເຫັນ: ມັນມີປະໂຫຍດ ສຳລັບການກວດສອບຮູບແບບ
ການຈັດຕັ້ງຄຳວັດຖຸ URL[a-zA-z]+://^[^\s]*
ຄວາມເຫັນ: ປະກອບການທີ່ຈະຈັດການຢູ່ອິນເຕີເນັດມີພຽງສິບຕິກຳດຽວ ແລະ ບໍ່ສາມາດຕອບກັບປະເພດທີ່ຍາວຂຶ້ນຫຼາຍໄດ້.
ຈັດຕັ້ງວ່າບັນຊີມີຄວາມຖືກຕ້ອງ (ເລີ່ມດ້ວຍອີລະຫັດ, allow 5-16 bytes, allow alphanumeric underscores)^[a-zA-Z][a-zA-Z0-9_]{4,15$
ຄວາມເຫັນ: ມັນມີປະໂຫຍດ ສຳລັບການກວດສອບຮູບແບບ
ຈັດຕັ້ງໂທລະສັບທາງໃນປະເທດ\d{3}-\d{8}|\d{4}-\d{7}
ຄວາມເຫັນ: ການຈັດຕັ້ງຮູບແບບ 0511-4405222 ຫຼື 021-87888822
ຈັດຕັ້ງບັດທີ່ຢູ່ QQ[1-9]{0-9]{4,}
ຄວາມເຫັນ: ປະເທດຈີນ ບັດທີ່ຢູ່ QQ ສຽງສະເພາະ 10000
ຈັດຕັ້ງບັດທີ່ຢູ່ ປະເທດຈີນ[1-9]\d{5}(?!\d)
ຄວາມເຫັນ: ປະເທດຈີນ ບັດທີ່ຂອງຈີ່ຫຸ່ນ 6 ໂດຍຕາມຈຳນວນ
ຈັດຕັ້ງບັດທີ່ຢູ່\d{15}|\d{18}
ຄວາມເຫັນ: ປະເພດບັດທີ່ຂອງ ປະເທດຈີນ 15 ຫຼື 18 ໂດຍຕາມຈຳນວນ
ຈັດຕັ້ງທີ່ຢູ່ IP\d+.\d+.\d+.\d+
ຄວາມເຫັນ: ມັນມີປະໂຫຍດ ສຳລັບການເຄື່ອງມືທີ່ຢູ່ IP
ຈັດຕັ້ງຈຳນວນສະເພາະ:
match floating1-9]\d*$//ຈັດຕັ້ງຈຳນວນທີ່ສູງ
^-[1-9]\d*$//ຈັດຕັ້ງຈຳນວນທີ່ຕໍ່າ
^-?[1-9]\d*$//ຈັດຕັ້ງຈຳນວນ
match floating1-9]\d*|0$Match non-ຈຳນວນທີ່ຕໍ່າ (ຈຳນວນທີ່ສູງ + 0)
^-[1-9]\d*|0$Match non-ຈຳນວນທີ່ສູງ (ຈຳນວນທີ່ຕໍ່າ + 0)
match floating1-9]\d*.\d*|0\.\d*[1-9]\d*$//Match positive floating-point numbers
^-([1-9]\d*.\d*|0\.\d*[1-9]\d*Match positive floating//)]$-point numbers
^-match negative floating1-9]\d*.\d*|0\.\d*[1-9]\d*^[+?([//|0)$-point numbers
match floating1-9]\d*.\d*|0\.\d*[1-9]\d*^[+|0$Match non-|0?\.0-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)
Notes: Useful when dealing with large amounts of data, pay attention to corrections in specific applications.
Match specific strings
^[A-Za-z]+$//Match a string of 26 English letters
^[A-Z]+$//Matches a string of 26 English letters
^[a-z]+$//Matches a string of 26 lowercase letters
^[A-Za-z0-9]+$//Match a string of numbers and 26 letters
^\w+$//Matches a string consisting of numbers, 26 letters, or underscores
characterdescribe
\Marks the next character as a special character, or a literal character, or a backward reference, or an octal escape character. For example, "n" matches the character "n". " n" matches a newline character. The sequence "\" matches "" and " (" matches " (").
^Matches the starting position of the input string. If the Multiline property of the RegExp object is set, ^ also matches the position after " n" or " r".
$Matches the end position 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 * can match "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 once. For example, "do (es)?" can match "do" in "do" or "does".? is equivalent to {0,1}.
{n}n ບໍ່ແມ່ນອັດຕາສາມະນາຍ-2" does not match the "o" in "Bob", but it does match two o's in "food".
{n,}n ບໍ່ແມ່ນອັດຕາສາມະນາຍ-negative integer. Matches at least n times. For example, "o {2,}" does not match "o" in "Bob", but does match all o in "foooood". "o {1,}" is equivalent to "o +". "o {0,}" is equivalent to "o *".
{n,m}m and n are both non-negative integers, where n < = m. Match at least n times and at most m times. For example, "o {1,3}" will match the first three o's in "fooooood". "o {0,1}" is equivalent to "o?". Note that there can be no spaces between commas and two numbers.
?When the character immediately follows any other constraint(*,+,?,{n},{n,},{n,m}),the matching pattern is non greedy. The non greedy mode matches the searched string as little as possible, while the default greedy mode matches the searched string as much as possible.For example, for string "oooo", "o +?" will match a single "o", and "o +" will match all "o".
.Matches any single character except " n". To match any character including " n", use a pattern like "[.n]".
(pattern)Matches the pattern and gets the match. The obtained match can be obtained from the resulting Matches collection, using the SubMatches collection in VBScript and the 0 dollars... 9 dollars attribute in JScript. To match parenthesis characters, use " (" or ") ".
(?:pattern)Matches a pattern but does not obtain a match result, that is, it is a non-fetching 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 shorter expression than "industry | industries".
(?=pattern)Forward lookup matches the lookup string at the beginning of any string that matches the pattern. This is a non-fetch match, that is, the match does not need to be fetched for later use. For example, "Windows (? = 95 | 98 | NT | 2000) " ກົດຕັ້ງ "Windows"ໃນ "Windows2000", but not "Windows" in "Windows3.1". A lookup does not consume characters, that is, after a match occurs, the search for the next match starts immediately after the last match, rather than after the character containing the lookup.
(?!pattern)ກົດຕັ້ງຊອກຫາບໍ່ຕ້ອງຖືກກູ້ພາຍໃນຄຳແບບທີ່ບໍ່ຕົກລົງ. ນີ້ເປັນການຊອກຫາບໍ່ຕ້ອງຖືກກູ້-ການຊອກຫາບໍ່ຕ້ອງຖືກກູ້, ເວລາຫຼັງຈາກການກົດຕັ້ງ, ການຊອກຫາການກົດຕັ້ງຕໍ່ໄປເລີ່ມຫຼັງຈາກຄວາມທີ່ກວມມູນຊອກຫາ, ບໍ່ຫຼັງຈາກຄວາມທີ່ກວມມູນຊອກຫາ. 95 | 98 | NT | 2000) " ກົດຕັ້ງ "Windows"ໃນ "Windows3.1", ແຕ່ບໍ່ "Windows"ໃນ "Windows2000". ການຊອກຫາບໍ່ຄວບຄຸມຄວາມ, ເວລາຫຼັງຈາກການກົດຕັ້ງ, ການຊອກຫາການກົດຕັ້ງຕໍ່ໄປເລີ່ມຫຼັງຈາກຄວາມທີ່ກວມມູນຊອກຫາ, ບໍ່ຫຼັງຈາກຄວາມທີ່ກວມມູນຊອກຫາ.
x|yກົດຕັ້ງ x ຫຼື y. ເຊັ່ນ, "z | food" ກົດຕັ້ງ "z" ຫຼື "food". " (z | f) ood" ກົດຕັ້ງ "zood" ຫຼື "food".
[xyz]ກົດຕັ້ງຄວາມ. ກົດຕັ້ງຄວາມທີ່ຢູ່ໃນ. ເຊັ່ນ, "[abc]" ກົດຕັ້ງ "a"ໃນ "plain".
[^xyz]ກົດຕັ້ງຄວາມບໍ່ລະດັບ. ກົດຕັ້ງຄວາມທີ່ບໍ່ຢູ່ໃນ. ເຊັ່ນ, "[^ abc]" ກົດຕັ້ງ "p"ໃນ "plain".
[a-z]ກົດຕັ້ງຄວາມ. ກົດຕັ້ງຄວາມທີ່ຢູ່ໃນຂອບລະດັບ. ເຊັ່ນ, "[a-z]" ສາມາດກົດຕັ້ງຄວາມລະດັບຕໍ່າໃນຂອບ "a" ຫຼື "z".
[^a-z]ກົດຕັ້ງຄວາມບໍ່ລະດັບ. ກົດຕັ້ງຄວາມທີ່ບໍ່ຢູ່ໃນຂອບລະດັບ. ເຊັ່ນ, "[^ a-z]" ສາມາດກົດຕັ້ງຄວາມທີ່ບໍ່ຢູ່ໃນຂອບ "a" ຫຼື "z".
\bກົດຕັ້ງຂ້າງບໍ່ຄົນ. ທີ່ກ່ວາຄວາມ ແມ່ນຕຳແຫຼງລະຫວ່າງຄວາມ ແລະຈັກ. ເຊັ່ນ, "er b" ສາມາດກົດຕັ້ງ "er"ໃນ "never", ແຕ່ບໍ່ "er"ໃນ "verb".
\Bກົດຕັ້ງຄວາມບໍ່-ຂ້າງມີຄວາມ. "er B" ກົດຕັ້ງ "er"ໃນ "verb", ແຕ່ບໍ່ "er"ໃນ "never".
\cxກົດຕັ້ງຄວາມຄວຍຄວາມກຳນົດໂດຍ x. ຕົວຢ່າງ, cM ກົດຕັ້ງຄວາມ Control-M ຫຼື ການກະກຽມ. ຄູ່ມູນ x ຕ້ອງແມ່ນ A-Z ຫຼື a-z. ບໍ່ອາດ, c ຖືກນຳໃຊ້ຄືຄວາມ "c".
\dກົດຕັ້ງຄວາມຕາມຈຳນວນ. ຄືກັບ [0-9].
\Dກົດຕັ້ງຄວາມບໍ່-ຄວາມສະເຫຼີມຕາມຈຳນວນ. ຄືກັບ [^ 0-9].
\fກົດຕັ້ງຄວາມຍ້າຍໜ້າ. ຄືກັບ \x0c ແລະ \cL.
\nກົດຕັ້ງຄວາມສະເຫຼີມ. ຄືກັບ \x0a ແລະ \cJ.
\rMatches a carriage return. Equivalent to \x0d and \cM.
\sMatches any whitespace character, including spaces, tabs, page 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 that includes an underscore. Equivalent to "[A-Za-z0-9]".
\WMatches any non-word character. Equivalent to "[^ A-Za-z0-9]".
\xnMatches n, where n is the hexadecimal escape value. The hexadecimal escape value must be the length of the identified two numbers. For example, " \x41" matches "A". " \x041" is equivalent to " \x04 & 1". ASCII encoding can be used in regular expressions..
\numMatches num, where num is a positive integer. A reference to the match obtained. For example, " (.) 1" ຕົກລົງກັບສອງຄຳທີ່ຕາມຫນັງກັນ.
\nບົ່ງມະນາງອາກາດຫັນຍາບັນຫຼືການຫັນຍາກັບຫລັງ. ຖ້າ \n ໄດ້ຖືກກະຕຸ້ນໂດຍ n acquired subexpressions, ແລະ n ແມ່ນການຫັນຍາກັບຫລັງ. ອີງຕາມນັ້ນ, ຖ້າ n ແມ່ນຫົວໂລກ (0-7), ແລະ n ແມ່ນອາກາດຫັນຍາບັນ.
\nmບົ່ງມະນາງອາກາດຫັນຍາບັນຫຼືການຫັນຍາກັບຫລັງ. Nm ແມ່ນການຫັນຍາກັບຫລັງ ຖ້າ nm ໄດ້ຖືກກະຕຸ້ນໂດຍ nm acquirer expressions. ຖ້າ \nm ໄດ້ຖືກກະຕຸ້ນໂດຍ n acquirers, ແລະ n ແມ່ນການຫັນຍາກັບຫລັງຕໍ່ມາຕົວແທນ m. ຖ້າບໍ່ມີເງື່ອນໄຂກ່ອນນັ້ນ, ຖ້າ n ແລະ m ແມ່ນຫົວໂລກພື້ນ (0-7), ແລະ nm ຈະຕົກລົງກັບອາກາດຫັນຍາ nm.
\nmlຖ້າ n ແມ່ນຫົວໂລກພື້ນ (0-3), ແລະ m ແລະ l ແມ່ນຫົວໂລກພື້ນ (0-7), ອາກາດການຫັນຍາບັນ nml ໄດ້ຕົກລົງ.
\unຕົກລົງກັບ n, ເຊິ່ງ n ມີແມ່ນອັດຕາການສະແດງ Unicode ທີ່ມີ ສີ່ສິບສາມຫົວໂລກ. ເອງວ່າ \ u00A9 ຕົກລົງກັບອາກາດສັນຍາ (©).
ຄຳຕີຂອງທ່ານ: