Merge remote-tracking branch 'origin/develop'

* origin/develop:
  chore: 发布vscode版本0.0.5
  refactor: 修改email标题体现"邮箱"2字, 方便搜索
This commit is contained in:
宁宁 2019-08-13 12:33:34 +08:00
commit 1c505b4266
4 changed files with 116 additions and 74 deletions

View File

@ -6,13 +6,15 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
## [Unreleased] ## [Unreleased]
- Initial release - 0.0.5
1. 增加正则"迅雷链接" / "ed2k连接" / "磁力链接" / "子网掩码" / "linux文件(夹)路径" / "window文件(夹)路径"
- 0.0.4
1. 优化"大于0, 小于150, 支持小数位出现5"减少没必要的捕获
2. 修复"html注释"没有匹配换行符
- 0.0.3 - 0.0.3
1. 解决vscode低版本兼容问题 1. 解决vscode低版本兼容问题
2. 替换主页的git图地址 2. 替换主页的git图地址
- 0.0.4
1. 优化"大于0, 小于150, 支持小数位出现5"减少没必要的捕获
2. 修复"html注释"没有匹配换行符

View File

@ -1,19 +1,19 @@
# 正则大全 ![](https://img.shields.io/badge/状态-积极更新-673ab7.svg) ![](https://img.shields.io/badge/已收录-57条-4caf50.svg) ![](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://circleci.com/gh/any86/any-rule.svg?style=svg)](https://circleci.com/gh/any86/any-rule) # 正则大全 ![](https://img.shields.io/badge/状态-积极更新-673ab7.svg) ![](https://img.shields.io/badge/已收录-57条-4caf50.svg) ![](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://circleci.com/gh/any86/any-rule.svg?style=svg)](https://circleci.com/gh/any86/any-rule)
支持**图形界面** / **vscode插件**2种查询方式. 支持**图形界面** / **vscode插件**2种查询方式.
## :whale:图形界面 ## :whale:图形界面
https://any86.github.io/any-rule/ https://any86.github.io/any-rule/
## vscode插件 ## vscode插件
1. 安装vscode中插件搜索框输入**any-rule** 1. 安装vscode中插件搜索框输入**any-rule**
2. 安装完毕后按**F1**(或者ctrl+shift+p). 2. 安装完毕后按**F1**(或者ctrl+shift+p).
3. 输入"**zz**"可以看到正则列表. 3. 输入"**zz**"可以看到正则列表.
4. 或者**输入关键词**, 比如"手机". 4. 或者**输入关键词**, 比如"手机".
![预览动画加载中...](https://user-images.githubusercontent.com/8264787/62843347-d5188080-bceb-11e9-9daf-049876d3f773.gif) ![预览动画加载中...](https://picabstract-preview-ftn.weiyun.com/ftn_pic_abs_v3/be46d88ca7efd1494ac05cc8e9f0bc3bceada406a864adfd552b675ab1f6f05a6d0102841b9705bbc3ef0b2022bb40b5?pictype=scale&from=30113&version=3.3.3.3&uin=383514580&fname=68747470733a2f2f757365722d676f6c642d63646e2e786974752e696f2f323031392f382f322f313663353136633434366430396633623f773d34323026683d32343326663d67696626733d32353537383036.gif&size=750)
## 正则 ## 正则
### 迅雷链接 ### 迅雷链接
```javascript ```javascript
@ -170,7 +170,7 @@ https://any86.github.io/any-rule/
/^\d{4}(-)(1[0-2]|0?\d)\1([0-2]\d|\d|30|31)$/ /^\d{4}(-)(1[0-2]|0?\d)\1([0-2]\d|\d|30|31)$/
``` ```
### email地址 ### 邮箱地址(email)
```javascript ```javascript
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
``` ```

View File

@ -3,7 +3,7 @@
"publisher": "russell", "publisher": "russell",
"displayName": "any-rule", "displayName": "any-rule",
"description": "你要的\"正则\"都在这!", "description": "你要的\"正则\"都在这!",
"version": "0.0.4", "version": "0.0.5",
"engines": { "engines": {
"vscode": "^1.12.0" "vscode": "^1.12.0"
}, },
@ -67,205 +67,245 @@
"onCommand:extension.rule45", "onCommand:extension.rule45",
"onCommand:extension.rule46", "onCommand:extension.rule46",
"onCommand:extension.rule47", "onCommand:extension.rule47",
"onCommand:extension.rule48" "onCommand:extension.rule48",
"onCommand:extension.rule49",
"onCommand:extension.rule50",
"onCommand:extension.rule51",
"onCommand:extension.rule52",
"onCommand:extension.rule53",
"onCommand:extension.rule54",
"onCommand:extension.rule55",
"onCommand:extension.rule56"
], ],
"main": "./out/extension.js", "main": "./out/extension.js",
"contributes": { "contributes": {
"commands": [ "commands": [
{ {
"command": "extension.rule0", "command": "extension.rule0",
"title": "zz: A股代码" "title": "zz: 迅雷链接"
}, },
{ {
"command": "extension.rule1", "command": "extension.rule1",
"title": "zz: 大于0, 小于150, 支持小数位出现5, 如145.5, 用于判断考卷分数" "title": "zz: ed2k链接(宽松匹配)"
}, },
{ {
"command": "extension.rule2", "command": "extension.rule2",
"title": "zz: html注释" "title": "zz: 磁力链接(宽松匹配)"
}, },
{ {
"command": "extension.rule3", "command": "extension.rule3",
"title": "zz: md5格式(32位)" "title": "zz: 子网掩码"
}, },
{ {
"command": "extension.rule4", "command": "extension.rule4",
"title": "zz: 版本号格式必须为X.Y.Z" "title": "zz: linux\"文件夹\"路径"
}, },
{ {
"command": "extension.rule5", "command": "extension.rule5",
"title": "zz: 视频链接地址(视频格式可按需增删)" "title": "zz: linux\"文件\"路径"
}, },
{ {
"command": "extension.rule6", "command": "extension.rule6",
"title": "zz: 图片链接地址(图片格式可按需增删)" "title": "zz: window下\"文件夹\"路径"
}, },
{ {
"command": "extension.rule7", "command": "extension.rule7",
"title": "zz: 24小时制时间HH:mm:ss" "title": "zz: window下\"文件\"路径"
}, },
{ {
"command": "extension.rule8", "command": "extension.rule8",
"title": "zz: 12小时制时间hh:mm:ss" "title": "zz: A股代码"
}, },
{ {
"command": "extension.rule9", "command": "extension.rule9",
"title": "zz: base64格式" "title": "zz: 大于等于0, 小于等于150, 支持小数位出现5, 如145.5, 用于判断考卷分数"
}, },
{ {
"command": "extension.rule10", "command": "extension.rule10",
"title": "zz: 数字/货币金额(支持负数、千分位分隔符)" "title": "zz: html注释"
}, },
{ {
"command": "extension.rule11", "command": "extension.rule11",
"title": "zz: 数字/货币金额 (只支持正数、不支持校验千分位分隔符)" "title": "zz: md5格式(32位)"
}, },
{ {
"command": "extension.rule12", "command": "extension.rule12",
"title": "zz: 银行卡号16或19位" "title": "zz: 版本号格式必须为X.Y.Z"
}, },
{ {
"command": "extension.rule13", "command": "extension.rule13",
"title": "zz: 中文姓名" "title": "zz: 视频链接地址(视频格式可按需增删)"
}, },
{ {
"command": "extension.rule14", "command": "extension.rule14",
"title": "zz: 英文姓名" "title": "zz: 图片链接地址(图片格式可按需增删)"
}, },
{ {
"command": "extension.rule15", "command": "extension.rule15",
"title": "zz: 新能源车牌号" "title": "zz: 24小时制时间HH:mm:ss"
}, },
{ {
"command": "extension.rule16", "command": "extension.rule16",
"title": "zz: 非新能源车牌号" "title": "zz: 12小时制时间hh:mm:ss"
}, },
{ {
"command": "extension.rule17", "command": "extension.rule17",
"title": "zz: 车牌号(新能源+非新能源)" "title": "zz: base64格式"
}, },
{ {
"command": "extension.rule18", "command": "extension.rule18",
"title": "zz: URL链接(网址)" "title": "zz: 数字/货币金额(支持负数、千分位分隔符)"
}, },
{ {
"command": "extension.rule19", "command": "extension.rule19",
"title": "zz: 中国手机号(严谨), 根据工信部2019年最新公布的手机号段" "title": "zz: 数字/货币金额 (只支持正数、不支持校验千分位分隔符)"
}, },
{ {
"command": "extension.rule20", "command": "extension.rule20",
"title": "zz: 中国手机号(宽松), 只要是13,14,15,16,17,18,19开头即可" "title": "zz: 银行卡号16或19位"
}, },
{ {
"command": "extension.rule21", "command": "extension.rule21",
"title": "zz: 中国手机号(最宽松), 只要是1开头即可, 如果你的手机号是用来接收短信, 优先建议选择这一条" "title": "zz: 中文姓名"
}, },
{ {
"command": "extension.rule22", "command": "extension.rule22",
"title": "zz: 日期, 如: 2000-01-01或2000-1-1" "title": "zz: 英文姓名"
}, },
{ {
"command": "extension.rule23", "command": "extension.rule23",
"title": "zz: email地址" "title": "zz: 新能源车牌号"
}, },
{ {
"command": "extension.rule24", "command": "extension.rule24",
"title": "zz: 国内座机电话,如: 0341-86091234" "title": "zz: 非新能源车牌号"
}, },
{ {
"command": "extension.rule25", "command": "extension.rule25",
"title": "zz: 一代身份证号(15位数字)" "title": "zz: 车牌号(新能源+非新能源)"
}, },
{ {
"command": "extension.rule26", "command": "extension.rule26",
"title": "zz: 二代身份证号(18位数字),最后一位是校验位,可能为数字或字符X" "title": "zz: 网址"
}, },
{ {
"command": "extension.rule27", "command": "extension.rule27",
"title": "zz: 身份证号, 支持1/2代(15位/18位数字)" "title": "zz: 中国手机号(严谨), 根据工信部2019年最新公布的手机号段"
}, },
{ {
"command": "extension.rule28", "command": "extension.rule28",
"title": "zz: 护照(包含香港、澳门)" "title": "zz: 中国手机号(宽松), 只要是13,14,15,16,17,18,19开头即可"
}, },
{ {
"command": "extension.rule29", "command": "extension.rule29",
"title": "zz: 帐号是否合法(字母开头允许5-16字节允许字母数字下划线组合" "title": "zz: 中国手机号(最宽松), 只要是1开头即可, 如果你的手机号是用来接收短信, 优先建议选择这一条"
}, },
{ {
"command": "extension.rule30", "command": "extension.rule30",
"title": "zz: 纯中文/汉字" "title": "zz: 日期"
}, },
{ {
"command": "extension.rule31", "command": "extension.rule31",
"title": "zz: 是否小数" "title": "zz: 邮箱地址(email)"
}, },
{ {
"command": "extension.rule32", "command": "extension.rule32",
"title": "zz: 电话(座机)" "title": "zz: 国内座机电话,如: 0341-86091234"
}, },
{ {
"command": "extension.rule33", "command": "extension.rule33",
"title": "zz: 纯数字" "title": "zz: 一代身份证号(15位数字)"
}, },
{ {
"command": "extension.rule34", "command": "extension.rule34",
"title": "zz: 是否html标签(宽松匹配)" "title": "zz: 二代身份证号(18位数字),最后一位是校验位,可能为数字或字符X"
}, },
{ {
"command": "extension.rule35", "command": "extension.rule35",
"title": "zz: 是否qq号格式正确" "title": "zz: 身份证号, 支持1/2代(15位/18位数字)"
}, },
{ {
"command": "extension.rule36", "command": "extension.rule36",
"title": "zz: 是否由数字和字母组成" "title": "zz: 护照(包含香港、澳门)"
}, },
{ {
"command": "extension.rule37", "command": "extension.rule37",
"title": "zz: 纯英文字母" "title": "zz: 帐号是否合法(字母开头允许5-16字节允许字母数字下划线组合"
}, },
{ {
"command": "extension.rule38", "command": "extension.rule38",
"title": "zz: 纯小写英文字母组成" "title": "zz: 纯中文/汉字"
}, },
{ {
"command": "extension.rule39", "command": "extension.rule39",
"title": "zz: 纯大写英文字母" "title": "zz: 是否小数"
}, },
{ {
"command": "extension.rule40", "command": "extension.rule40",
"title": "zz: 密码强度正则最少6位包括至少1个大写字母1个小写字母1个数字1个特殊字符" "title": "zz: 电话(座机)"
}, },
{ {
"command": "extension.rule41", "command": "extension.rule41",
"title": "zz: 用户名正则4到16位字母数字下划线减号" "title": "zz: 纯数字"
}, },
{ {
"command": "extension.rule42", "command": "extension.rule42",
"title": "zz: ip-v4" "title": "zz: 是否html标签(宽松匹配)"
}, },
{ {
"command": "extension.rule43", "command": "extension.rule43",
"title": "zz: ip-v6" "title": "zz: 是否qq号格式正确"
}, },
{ {
"command": "extension.rule44", "command": "extension.rule44",
"title": "zz: 16进制颜色" "title": "zz: 是否由数字和字母组成"
}, },
{ {
"command": "extension.rule45", "command": "extension.rule45",
"title": "zz: 微信号6至20位以字母开头字母数字减号下划线" "title": "zz: 纯英文字母"
}, },
{ {
"command": "extension.rule46", "command": "extension.rule46",
"title": "zz: 中国邮政编码" "title": "zz: 纯小写英文字母组成"
}, },
{ {
"command": "extension.rule47", "command": "extension.rule47",
"title": "zz: 只包含中文和数字" "title": "zz: 纯大写英文字母"
}, },
{ {
"command": "extension.rule48", "command": "extension.rule48",
"title": "zz: 密码强度正则最少6位包括至少1个大写字母1个小写字母1个数字1个特殊字符"
},
{
"command": "extension.rule49",
"title": "zz: 用户名正则4到16位字母数字下划线减号"
},
{
"command": "extension.rule50",
"title": "zz: ip-v4"
},
{
"command": "extension.rule51",
"title": "zz: ip-v6"
},
{
"command": "extension.rule52",
"title": "zz: 16进制颜色"
},
{
"command": "extension.rule53",
"title": "zz: 微信号6至20位以字母开头字母数字减号下划线"
},
{
"command": "extension.rule54",
"title": "zz: 中国邮政编码"
},
{
"command": "extension.rule55",
"title": "zz: 只包含中文和数字"
},
{
"command": "extension.rule56",
"title": "zz: 不能包含字母" "title": "zz: 不能包含字母"
} }
] ]

View File

@ -159,7 +159,7 @@ module.exports = [
examples: ['1990-12-12', '2020-1-1'] examples: ['1990-12-12', '2020-1-1']
}, },
{ {
title: 'email地址', title: '邮箱地址(email)',
rule: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, rule: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,
examples: ['90203918@qq.com', 'nbilly@126.com'] examples: ['90203918@qq.com', 'nbilly@126.com']
}, },