forked from cdoco/common-regex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
113 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,44 @@ | |
|
||
![Regex](images/regex.png) | ||
|
||
## Table of Contents | ||
## 目录 | ||
|
||
- [Email](#email) | ||
- [Phone](#phone) | ||
- [Domain-name](#domain-name) | ||
- [邮箱](#邮箱) | ||
- [电话](#电话) | ||
- [域名](#域名) | ||
- [IP](#ip) | ||
|
||
|
||
`[email protected]` | ||
- [数字正则](#数字正则) | ||
- [整数](#整数) | ||
- [正整数](#正整数) | ||
- [负整数](#负整数) | ||
- [非负整数](#非负整数) | ||
- [非正整数](#非正整数) | ||
- [浮点数](#浮点数) | ||
- [正浮点数](#正浮点数) | ||
- [负浮点数](#负浮点数) | ||
- [非负浮点数](#非负浮点数) | ||
- [非正浮点数](#非正浮点数) | ||
|
||
|
||
## 邮箱 | ||
|
||
`[email protected]` 只允许英文字母、数字、下划线、英文句号、以及中划线组成 | ||
|
||
```regex | ||
^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$ | ||
``` | ||
|
||
![email](images/email.png) | ||
|
||
## Phone | ||
`高子航[email protected]` 名称允许汉字、字母、数字,域名只允许英文域名 | ||
|
||
```regex | ||
^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$ | ||
``` | ||
|
||
![email](images/email2.png) | ||
|
||
## 电话 | ||
|
||
`13012345678` | ||
|
||
|
@@ -29,7 +49,7 @@ | |
|
||
![email](images/phone.png) | ||
|
||
## Domain-name | ||
## 域名 | ||
|
||
`https://google.com` | ||
|
||
|
@@ -47,4 +67,86 @@ | |
((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)) | ||
``` | ||
|
||
![ip](images/ip.png) | ||
![ip](images/ip.png) | ||
|
||
## 数字正则 | ||
|
||
### 整数 | ||
|
||
```regex | ||
^-?[1-9]\d*$ | ||
``` | ||
|
||
![num](images/num1.png) | ||
|
||
### 正整数 | ||
|
||
```regex | ||
^[1-9]\d*$ | ||
``` | ||
|
||
![num](images/num2.png) | ||
|
||
### 负整数 | ||
|
||
```regex | ||
^-[1-9]\d*$ | ||
``` | ||
|
||
![num](images/num3.png) | ||
|
||
### 非负整数 | ||
|
||
```regex | ||
^[1-9]\d*|0$ | ||
``` | ||
|
||
![num](images/num4.png) | ||
|
||
### 非正整数 | ||
|
||
```regex | ||
^-[1-9]\d*|0$ | ||
``` | ||
|
||
![num](images/num5.png) | ||
|
||
### 浮点数 | ||
|
||
```regex | ||
^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$ | ||
``` | ||
|
||
![num](images/num6.png) | ||
|
||
### 正浮点数 | ||
|
||
```regex | ||
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$ | ||
``` | ||
|
||
![num](images/num7.png) | ||
|
||
### 负浮点数 | ||
|
||
```regex | ||
^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$ | ||
``` | ||
|
||
![num](images/num8.png) | ||
|
||
### 非负浮点数 | ||
|
||
```regex | ||
^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$ | ||
``` | ||
|
||
![num](images/num9.png) | ||
|
||
### 非正浮点数 | ||
|
||
```regex | ||
^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$ | ||
``` | ||
|
||
![num](images/num10.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.