Test the regular address online

tool.oschina.net/regex/

Tencent QQ number

Tencent QQ id starts from 10000

[1-9] [0-9] {4}

China Postcode

Chinese postcodes are six digits long

[1-9]\d{5}(? ! \d)

email

[email protected] can contain only letters, digits, underscores (_), periods (.), and hyphens (-)

^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$

[email protected] The name can contain Chinese characters, letters, and digits, and the domain name can only contain English domain names

^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$

The phone

13412345678 mobile phone no.

^1(3|4|5|6|7|8|9)\d{9}$

Xxxx-xxxxxxx XXXX-XXXXXXXX Fixed telephone number

(\ \ d {3, 4} \) | \ d {3, 4} – | \ s)? \d{8}

The domain name

[https://google.com/](https://google.com/)

^((http:\/\/)|(https:\/\/))? ([a – zA – Z0-9] ([a zA – Z0-9 \], 21 {0} [a – zA – Z0-9])? \.) + [a zA – Z] {2, 6} (\ /)

Id card

Fifteen or eighteen

^\d{15}|\d{18}$

IP

127.0.0.1

((? : (? :25[0-5]|2[0-4]\d|[01]? \d? \d)\.) {3} (? :25[0-5]|2[0-4]\d|[01]? \d? \d))

Account check

Xxxzhang_001 must start with a letter and contain 5 to 16 bytes. Alphanumeric underscores (_) are allowed

^ [a zA – Z] [a – zA – Z0-9 _] {4, 15} $

The date of

The date format

^ \ d {4} \ d {1, 2} – \ d {1, 2}

Twelve months of the year

(01 ~ 09 and 1 ~ 12)

^ (0? [1-9] [2-0]) $| 1

31 days in a month

(01 ~ 09 and 1 ~ 31)

^ ((0? [1-9]) | | 2 (1) ([0-9]) | | 31) $30

Character checking

Blank lines

Can be used to delete blank lines

\n\s*\r

HTML tags

<(\S*?) [^ >] * >. *? < 1 > / \ | <. *? />

First and last whitespace characters

Can be used to remove whitespace at the beginning and end of a line (including Spaces, tabs, page feeds, and so on)

^ | \ \ s * s * or (^ \ \ s \ *) | (\ \ s \ *)

Chinese characters

China

^[\u4e00-\u9fa5]{0,}$

English and Numbers

^[A-Za-z0-9]+$

The value contains 3 to 20 characters

^. {3, 20} $

The English characters

The value is a string of 26 English letters

^[A-Za-z]+$

A string consisting of 26 uppercase English letters

^[A-Z]+$

The value is a string of 26 lowercase letters

^[a-z]+$

The value is a string of 26 letters and numbers

^[A-Za-z0-9]+$

The value is a string of 26 letters, digits, and underscores

^\w+$

Chinese, English, and digits including underscores (_)

^[\u4E00-\u9FA5A-Za-z0-9_]+$

Chinese characters, English characters, digits but not underscores

^[\u4E00-\u9FA5A-Za-z0-9]+$

Disallow input containing %&’,; =? $” character, etc

[^%&’,;=?$\x22]+

Do not enter characters containing ~

[^~\x22]+

Number of regular

The integer

^ -? [1-9]\d*$

Positive integer

^[1-9]\d*$

Negative integer

^-[1-9]\d*$

Non-negative integer

^[1-9]\d*|0$

A positive integer

^-[1-9]\d*|0$

Floating point Numbers

^ -? ([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0? $\. | 0 + 0)

Are floating point Numbers

^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$

Negative floating point number

^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$

Non-negative floating point number

^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0? \. | 0 0 + $

A non-positive floating point number

^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0? \. | 0 0 + $