1 Star 1 Fork 1

guapian / common-regex

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

目录

邮箱

gaozihang-001@gmail.com 只允许英文字母、数字、下划线、英文句号、以及中划线组成

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

email

高子航001Abc@bowbee.com.cn 名称允许汉字、字母、数字,域名只允许英文域名

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

email

电话

13012345678 手机号

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

phone

XXX-XXXXXXX XXXX-XXXXXXXX 固定电话

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

email

域名

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

帐号校验

gaozihang_001 字母开头,允许5-16字节,允许字母数字下划线

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

user

字符校验

汉字

高子航

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

chinese

英文和数字

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

char

长度为3-20的所有字符

^.{3,20}$

char

英文字符

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

^[A-Za-z]+$

char

由26个大写英文字母组成的字符串

^[A-Z]+$

char

由26个小写英文字母组成的字符串

^[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

The MIT License (MIT) Copyright (c) 2016 ZiHang Gao <ocdoco@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

https://github.com/cdoco/common-regex 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/guapian/common-regex.git
git@gitee.com:guapian/common-regex.git
guapian
common-regex
common-regex
master

搜索帮助