Merge branch 'master' into develop

This commit is contained in:
383514580 2020-04-04 22:18:47 +08:00
commit cd97f8d574
13 changed files with 80 additions and 49 deletions

View File

@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:8.9.4
- image: circleci/node:12.14.1
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images

View File

@ -1,6 +1,10 @@
# 更新日志
🚀 [提交问题](https://github.com/any86/any-rule/issues/new)
### 0.3.2(2020-04-03)
- 修复"linux文件夹"正则不能匹配"/".
- 部分正则标题增加"英文关键字", 方便检索.
### 0.3.1 (2020-03-12)
- 修复"@zz唤醒"和"菜单唤醒"在某些机型下失效的bug.
- 修复"设置后未生效".

View File

@ -33,7 +33,7 @@ vscode应用商店中搜索"**any-rule**".
## 👩‍🏫图解正则
<details>
<summary>查看详情</summary>
在vscode中选择正则后, 可点击"🤖图解正则".
每次在any-rule中选择正则后会弹出提示, 可点击"🤖图解正则".
![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e32c3a6fb116?w=533&h=95&f=png&s=21563)
@ -89,9 +89,9 @@ vscode应用商店中搜索"**any-rule**".
/^((ht|f)tps?:\/\/)?[\w-]+(\.[\w-]+)+:\d{1,5}\/?$/
```
### 网址(支持端口和"?+参数"和"#+参数)
### 网址(url,支持端口和"?+参数"和"#+参数)
```javascript
/^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?$/
/^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$/
```
### 统一社会信用代码
@ -121,17 +121,17 @@ vscode应用商店中搜索"**any-rule**".
### linux"隐藏文件"路径
```javascript
/^\/(?:[^\/]+\/)*\.[^\/]*/
/^\/(?:[^/]+\/)*\.[^/]*/
```
### linux文件夹路径
```javascript
/^\/(?:[^\/]+\/)*$/
/^\/(?:[^/]+\/)*$/
```
### linux文件路径
```javascript
/^\/(?:[^\/]+\/)*[^\/]+$/
/^\/(?:[^/]+\/)*[^/]+$/
```
### window"文件夹"路径
@ -164,17 +164,17 @@ vscode应用商店中搜索"**any-rule**".
/^([a-f\d]{32}|[A-F\d]{32})$/
```
### 版本号格式必须为X.Y.Z
### 版本号(version)格式必须为X.Y.Z
```javascript
/^\d+(?:\.\d+){2}$/
```
### 视频链接地址(视频格式可按需增删)
### 视频(video)链接地址(视频格式可按需增删)
```javascript
/^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i
```
### 图片链接地址(图片格式可按需增删)
### 图片(image)链接地址(图片格式可按需增删)
```javascript
/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i
```
@ -191,7 +191,7 @@ vscode应用商店中搜索"**any-rule**".
### base64格式
```javascript
/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*?)\s*$/i
/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i
```
### 数字/货币金额(支持负数、千分位分隔符)
@ -234,32 +234,32 @@ vscode应用商店中搜索"**any-rule**".
/^(?:[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领 A-Z]{1}[A-HJ-NP-Z]{1}(?:(?:[0-9]{5}[DF])|(?:[DF](?:[A-HJ-NP-Z0-9])[0-9]{4})))|(?:[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领 A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9 挂学警港澳]{1})$/
```
### 手机号中国(严谨), 根据工信部2019年最新公布的手机号段
### 手机号(mobile phone)中国(严谨), 根据工信部2019年最新公布的手机号段
```javascript
/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-7|9])|(?:5[0-3|5-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1|8|9]))\d{8}$/
```
### 手机号中国(宽松), 只要是13,14,15,16,17,18,19开头即可
### 手机号(mobile phone)中国(宽松), 只要是13,14,15,16,17,18,19开头即可
```javascript
/^(?:(?:\+|00)86)?1[3-9]\d{9}$/
```
### 手机号中国(最宽松), 只要是1开头即可, 如果你的手机号是用来接收短信, 优先建议选择这一条
### 手机号(mobile phone)中国(最宽松), 只要是1开头即可, 如果你的手机号是用来接收短信, 优先建议选择这一条
```javascript
/^(?:(?:\+|00)86)?1\d{10}$/
```
### 日期
### date(日期)
```javascript
/^\d{4}(-)(1[0-2]|0?\d)\1([0-2]\d|\d|30|31)$/
```
### email(邮箱)
```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])?)*$/
```
### 座机电话(国内),如: 0341-86091234
### 座机(tel phone)电话(国内),如: 0341-86091234
```javascript
/\d{3}-\d{8}|\d{4}-\d{7}/
```
@ -359,7 +359,7 @@ vscode应用商店中搜索"**any-rule**".
/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
```
### 微信号6至20位以字母开头字母数字减号下划线
### 微信号(wx)6至20位以字母开头字母数字减号下划线
```javascript
/^[a-zA-Z][-_a-zA-Z0-9]{5,19}$/
```

View File

@ -3,7 +3,7 @@
"publisher": "russell",
"displayName": "any-rule",
"description": "你要的\"正则\"都在这!",
"version": "0.3.1",
"version": "0.3.2",
"scripts": {
"build:md": "node ./scripts/md.js",
"build": "npm run test:rules && npm version patch && node ./scripts/genCommond.js && vsce package && npm run build:md",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -6,6 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="manifest" href="<%= BASE_URL %>manifest.json">
<title>正则大全</title>
<!-- 百度统计 -->
<script>
@ -20,9 +21,10 @@
<!-- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/styles/github.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/highlight.min.js"></script> -->
<style>
:root{
:root {
--primary: #42b983;
}
* {
padding: 0;
margin: 0;
@ -47,26 +49,30 @@
list-style-type: none;
}
@keyframes rotate{
from{
@keyframes rotate {
from {
transform: rotate(0);
}
to{
to {
transform: rotate(360deg);
}
}
.loading{
.loading {
animation: rotate 1s infinite linear;
margin:0;
padding:0;
margin: 0;
padding: 0;
position: fixed;
top:0;left:0;right: 0;bottom:0;
margin:auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
display: block;
width:100px;
height:100px;
border:0 solid #42b983;
width: 100px;
height: 100px;
border: 0 solid #42b983;
border-right-width: 4px;
border-radius: 50%;
}
@ -77,7 +83,7 @@
<noscript>
<strong>We're sorry but any-rule doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app">
<i class="loading"></i>
</div>

View File

@ -0,0 +1,15 @@
{
"short_name": "any-rule",
"name": "正则大全",
"icons": [
{
"src": "/any-rule/icon.png",
"type": "image/png",
"sizes": "192x192"
}
],
"background_color": "#2196F3",
"theme_color": "#2196F3",
"display": "standalone",
"start_url": "/any-rule"
}

View File

View File

@ -15,7 +15,7 @@ module.exports = [{
counterExamples: ['192.168.1.1', 'https://www.jd.com']
},
{
title: '网址(支持端口和"?+参数"和"#+参数)',
title: '网址(url,支持端口和"?+参数"和"#+参数)',
rule: /^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$/,
examples: ['www.qq.com', 'https://baidu.com', '360.com:8080/vue/#/a=1&b=2'],
counterExamples: ['....']
@ -94,17 +94,17 @@ module.exports = [{
examples: ['21fe181c5bfc16306a6828c1f7b762e8'],
},
{
title: '版本号格式必须为X.Y.Z',
title: '版本号(version)格式必须为X.Y.Z',
rule: /^\d+(?:\.\d+){2}$/,
examples: ['16.3.10']
},
{
title: '视频链接地址(视频格式可按需增删)',
title: '视频(video)链接地址(视频格式可按需增删)',
rule: /^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i,
examples: ['http://www.abc.com/video/wc.avi']
},
{
title: '图片链接地址(图片格式可按需增删)',
title: '图片(image)链接地址(图片格式可按需增删)',
rule: /^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i,
examples: ['https://www.abc.com/logo.png']
},
@ -165,22 +165,22 @@ module.exports = [{
examples: ['京A12345D', '京A00599']
},
{
title: '手机号中国(严谨), 根据工信部2019年最新公布的手机号段',
title: '手机号(mobile phone)中国(严谨), 根据工信部2019年最新公布的手机号段',
rule: /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-7|9])|(?:5[0-3|5-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1|8|9]))\d{8}$/,
examples: ['008618311006933', '+8617888829981', '19119255642']
},
{
title: '手机号中国(宽松), 只要是13,14,15,16,17,18,19开头即可',
title: '手机号(mobile phone)中国(宽松), 只要是13,14,15,16,17,18,19开头即可',
rule: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
examples: ['008618311006933', '+8617888829981', '19119255642']
},
{
title: '手机号中国(最宽松), 只要是1开头即可, 如果你的手机号是用来接收短信, 优先建议选择这一条',
title: '手机号(mobile phone)中国(最宽松), 只要是1开头即可, 如果你的手机号是用来接收短信, 优先建议选择这一条',
rule: /^(?:(?:\+|00)86)?1\d{10}$/,
examples: ['008618311006933', '+8617888829981', '19119255642']
},
{
title: '日期',
title: 'date(日期)',
rule: /^\d{4}(-)(1[0-2]|0?\d)\1([0-2]\d|\d|30|31)$/,
examples: ['1990-12-12', '2020-1-1']
},
@ -190,7 +190,7 @@ module.exports = [{
examples: ['90203918@qq.com', 'nbilly@126.com']
},
{
title: '座机电话(国内),如: 0341-86091234',
title: '座机(tel phone)电话(国内),如: 0341-86091234',
rule: /\d{3}-\d{8}|\d{4}-\d{7}/,
examples: ['0936-4211235']
},
@ -291,7 +291,7 @@ module.exports = [{
examples: ['#f00', '#F90', '#000', '#fe9de8']
},
{
title: '微信号6至20位以字母开头字母数字减号下划线',
title: '微信号(wx)6至20位以字母开头字母数字减号下划线',
rule: /^[a-zA-Z][-_a-zA-Z0-9]{5,19}$/,
examples: ['github666', 'kd_-666']
},

View File

@ -3,6 +3,12 @@ import App from './App.vue'
Vue.config.productionTip = false
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('./sw.js');
});
}
new Vue({
render: h => h(App),
}).$mount('#app')
render: h => h(App),
}).$mount('#app')

View File

@ -57,7 +57,7 @@ vscode应用商店中搜索"**any-rule**".
## 👩🏫图解正则
<details>
<summary>查看详情</summary>
在vscode中选择正则后, 可点击"🤖图解正则".
每次在any-rule中选择正则后会弹出提示, 可点击"🤖图解正则".
![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e32c3a6fb116?w=533&h=95&f=png&s=21563)

View File

@ -219,9 +219,9 @@
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==
acorn@^6.2.1:
version "6.4.0"
resolved "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784"
integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==
version "6.4.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474"
integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==
agent-base@4, agent-base@^4.3.0:
version "4.3.0"