설명regular expression
웹사이트 (URL)[a-zA-z]+://[^\s]*
IP 주소((2]|-4]\d|25]|-5]|[01]?\d\d?)\.){3}2]|-4]\d|25]|-5]|[01]?\d\d?)
이메일 주소\w+([-+.]\w+)*@\w+([-.]\w+)*\..\w+([-.]\w+)*
QQ 번호[1-9]\d{4,}
HTML 마크업 (내용이나 자기-닫기)<(*)(*)>.*<\/\1>|<(*) \"/>
패스워드 (숫자로 구성됩니다/대문자/lowercase letters/표점, 모두 네 가지가 있어야 합니다, 더 많은 8 digits)(?=^.{8,}$)(?=.*\d)(?=.*\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\n).*$
날짜 (년-월-일)(\d{4}|\d{2)-((1]|-2))|(0?[1-9))-(([12][0-9))|(3]|1))|(0?[1-9))
날짜 (월/일/연도)((1]|-2))|(0?[1-9))/(([12][0-9))|(3]|1))|(0?[1-9))/(\d{4}|\d{2)
시간 (시: 분, 24-시간 시계)((1|0?)[0-9]|}}2]|-3]:([0-5][0-9]
중국 (문자)[\u4e00-\u9fa5]
중국과 전체-넓이 표점 (문자)[\u3000-\u301e\ufe10-\ufe19\ufe30-\ufe44\ufe50-\ufe6b\uff01-\uffee]
중국 대륙 전화 번호(\d{4}-|\d{3}-)?(\d{8}|\d{7)
중국 대륙 휴대폰 번호1\d{10}
중국 대륙 우편编码[1-9]\d{5}
중국 대륙 주민 등록번호 (15 또는 18 digits)\d{15}(\d\d[0-9xX])?
비-부정수 (정수 또는 0)\d+
정수]|-9]*[1-9][0-9]*
부정수-]|-9]*[1-9][0-9]*
정수-?\d+
십진수(-?\d+)(\.\d+)?
abc를 포함하지 않는 단어\b((?!abc)\w)+\b
설명regular 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-이메일 주소/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
URL/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?)$/
IP 주소/^((?:25]|-5]|}}2]|-4][0-9]|[01]?[0-9][0-9}325]|-5]|}}2]|-4][0-9]|[01]?[0-9][0-9]?)$/
HTML 태그/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/
Unicode 인코딩에서 중국 문자의 범위/^[u4e00-u9fa5],{0,}$/
중국 문자 일치 정규 표현식[\u4e00-\u9fa5]
주의事项: 중국 문자 일치는 정말로 머리 아파요. 이 표현식을 사용하면 쉽게 처리할 수 있습니다
두 자릿수 일치-바이트 문자(중국 문자 포함)[^\x00-\xff]
주의事项: 문자열 길이를 계산하는 데 사용할 수 있습니다 (2 두 자릿수)-바이트 문자, 1 ASCII 문자)
빈 줄 일치 정규 표현식\n\s*\r
주의事项: 빈 줄을 지우는 데 사용할 수 있습니다.
HTML 태그 일치 정규 표현식<(\S*?)[^>]*>.*<?/\1>|<.*?/>
주의事项: 인터넷에서 순회하는 버전은 너무 나쁩니다. 위의 버전은 일부 일치할 수 있지만, 복잡한 내부 태그에 대한 일치는 여전히 무력합니다.
처음과 마지막 공백 문자 일치 정규 표현식^\s*|\s*$
주의事项: 행의 시작과 끝에 있는 공백 문자(공백, 탭, 페이지 분리 등)를 제거할 수 있습니다. 매우 유용한 표현식입니다.
이메일 주소 일치 정규 표현식\w+([-+.]\w+)*@\w+([-.]\w+)*\..\w+([-.]\w+)*
주의事项: 양식 검증에 유용
정규 표현식으로 URL 일치[a-zA-z]+://[^\s]*
주의事项: 인터넷에서 순회하는 버전은 기능이 매우 제한적이며, 위의 것은 기본적인 필요를 충족할 수 있습니다.
계정이 법적인지 일치 5-16 바이트, 알파넘berg 자릿수 허용)^[a-zA-Z][a-zA-Z0-9_]{4,15$
주의事项: 양식 검증에 유용
국내 전화번호 일치\d{3}-\d{8}|\d{4}-\d{7}
주의事项: 0과 같은 일치 형식511-4405222 또는 021-87888822
텐센트 QQ 번호 일치[1-9][0-9]{4,}
주의事项: 텐센트 QQ 번호는 10000
중국 대륙 우편编码 일치[1-9]\d{5}(?!\d)
주의事项: 중국 대륙 우편编码은 6 숫자
ID 일치\d{15}|\d{18}
주의事项: 중국 대륙 주민등록증은 15 또는 18 숫자
IP 주소 일치\d+\.\d+\.\d+\.\d+
주의事项: IP 주소 추출 시 유용
특정 숫자 일치:
^[1-9]\d*$//양수 일치
^-[1-9]\d*$//음수 일치
^-?[1-9]\d*$//정수 일치
^[1-9]\d*|0$Match non-음수 (양수 + 0)
^-[1-9]\d*|0$Match non-양수 (음수 + 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)
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 * *
+ + + 1
?1
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".
.任何一个字符(除了" n")进行匹配。要匹配任何字符包括" n",请使用类似于"[.n]"的模式。
(pattern)패턴과 일치하고 일치를 얻습니다. 얻은 일치는 결과 Matches 컬렉션에서 VBScript의 SubMatches 컬렉션을 사용하여 얻을 수 있습니다. 0 dollars... 9 JScript의 dollars 속성입니다. 괄호 문자를 일치시키려면 "(" 또는 ")"를 사용합니다.
(?:pattern)패턴과 일치하지만 일치 결과를 얻지 않습니다. 즉, 이는 비-fetching match이며 나중에 사용하기 위해 저장되지 않습니다. 이는 패턴의 일부를 결합하기 위해 "or" 문자 "|"를 사용할 때 유용합니다. 예를 들어, "industr (?: y | ies) "는 "industry | industries"보다 짧은 표현입니다.
(?=pattern)Forward lookup은 패턴과 일치하는 어떤 문자의 시작 부분에 있는 검색 문자와 일치합니다. 이는 비-fetch match, 즉, 일치를 나중에 사용하기 위해 가져오지 않아도 됩니다. 예를 들어, "Windows (? = 95 | 98 | NT | 2000) " matches "Windows" in "Windows2000", "Windows"에 "Windows"이 아닙니다.3.1". 검색은 문자를 소비하지 않습니다. 즉, 일치가 발생한 후 다음 일치를 찾는 것은 마지막 일치 이후로 바로 시작하며, 검색된 문자 이후로 시작하지 않습니다.
(?!pattern)Negative lookup matches the lookup 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, "Windows (?! 95 | 98 | NT | 2000) " matches "Windows" in "Windows3.1", but not "Windows" in "Windows2000". 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.
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 character contained. For example, "[abc]" matches "a" in "plain".
[^xyz]Set of negative characters. Matches any character not contained. For example, "[^ abc]" matches "p" in "plain".
[a-z]Character range. Matches any character in the specified range. For example, "[a-z]" can match any lowercase character in the range "a" to "z".
[^a-z]Negative character range. Matches any character not in the specified range. For example, "[^ a-z]" can match any character not in the range "a" to "z".
\bMatches a word boundary, which refers to the position between the word and the space. For example, "er b" can match "er" in "never", but not "er" in "verb".
\BMatches non-word boundaries. "er B" matches "er" in "verb", but not "er" in "never".
\cxMatches the control character specified by x. For example, cM matches a Control-M or carriage return. The value of x must be either 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-단어 문자. "[^ A-Za-z0-9_]".
\xnn과 일치하며, n은 16진수 응축 값입니다. 16진수 응축 값은 식별된 두 숫자의 길이여야 합니다. 예를 들어, " \x41"와 일치합니다. " \x041"는 " \x04 & 1". 정규 표현식에서 ASCII 인코딩을 사용할 수 있습니다.
\numnum과 일치하며, num은 양수 정수입니다. 일치한 매칭에 대한 참조. 예를 들어, " (.) 1"는 연속적으로 동일한 두 문자와 일치합니다.
\n8진수 응축 값 또는 후행 참조를 식별합니다. \n이 n 획득 서브 표현식에 앞서 있으면, n은 후행 참조입니다. 그렇지 않으면, n이 8진수 숫자(0-7), 그러면 n은 8진수 응축 값입니다.
\nm8진수 응축 값 또는 후행 참조를 식별합니다. nm이 nm 획득 표현식에 앞서 있으면 nm은 후행 참조입니다. \nm이 n 획득자에 앞서 있으면, n은 후행 참조이며 그 뒤에 literal m이 따릅니다. 이전 조건 중 어느 하나도 만족되지 않으면, n과 m이 모두 8진수 숫자(0-7), 그러면 nm은 8진수 응축 값 nm과 일치합니다.
\nmln이 8진수 숫자(0-3), 그리고 m과 l은 8진수 숫자(0-7), 8진 응축 값 nml과 일치합니다.
\unn과 일치하며, n은 네 개의 힙셀리터로 표현된 유니코드 문자입니다. 예를 들어, \ u00A9 저작권 기호(©)와 일치합니다.
당신의 발자국: