neoOpus / common-regex-EN-

:jack_o_lantern: Common Regular Expressions - A collection of regular expressions that are often used in regular project development. [Translated to English]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Table of contents

E-mail

gaozihang-001@gmail.com Only letters, numbers, underscores, periods, and underscores are allowed

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

email

高子航001Abc@bowbee.com.cn The name allows Chinese characters, letters and numbers, and the domain name only allows English domain names

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

email

Phone Number

13012345678 mobile phone number

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

phone

XXX-XXXXXXX XXXX-XXXXXXXX landline phone number

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

email

Domaine Name

https://google.com/

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

domain-name

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))

ip

Account verification

gaozihang_001 Start with a letter, allow 5-16 bytes, allow alphanumeric underscore

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

user

Character verification

Chinese characters

高子航

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

chinese

English characters and numbers

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

char

All characters from 3 to 20 in length

^.{3,20}$

char

English characters

String consisting of 26 letters of the alphabet

^[A-Za-z]+$

char

String consisting of 26 uppercase letters

^[A-Z]+$

char

String consisting of 26 uppercase letters

^[a-z]+$

char

由数字和26个英文字母组成的字符串

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

char

由数字、26个英文字母或者下划线组成的字符串

^\w+$

char

中文、英文、数字包括下划线

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

char

中文、英文、数字但不包括下划线等符号

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

char

禁止输入含有%&',;=?$"等字符

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

char

禁止输入含有~的字符

[^~\x22]+

char

数字正则

整数

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

num

正整数

^[1-9]\d*$

num

负整数

^-[1-9]\d*$

num

非负整数

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

num

非正整数

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

num

浮点数

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

num

正浮点数

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

num

负浮点数

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

num

非负浮点数

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

num

非正浮点数

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

num

License

MIT License. See the LICENSE file.

⬆ top

About

:jack_o_lantern: Common Regular Expressions - A collection of regular expressions that are often used in regular project development. [Translated to English]

License:MIT License