From 84e0699fa5bd93303b3b6d7f20d3568ffa698953 Mon Sep 17 00:00:00 2001 From: liufeng Date: Fri, 4 Jun 2021 18:26:53 +0800 Subject: [PATCH 01/28] =?UTF-8?q?feat(components):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=A2=ABmoment=E8=BD=AC=E5=8C=96=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E7=9A=84=E6=97=B6=E9=97=B4=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++++++- packages/www/src/RULES.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75ebfe2..eeb6e05 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 正则大全 ![已收录70条](https://img.shields.io/badge/已收录-70条-673ab7.svg) [![版本](https://badgen.net/vs-marketplace/v/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![安装量](https://badgen.net/vs-marketplace/i/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![下载量](https://badgen.net/vs-marketplace/d/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) ![MIT](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://badgen.net/github/status/any86/any-rule/master/ci/circleci)](https://circleci.com/gh/any86/any-rule) +# 正则大全 ![已收录71条](https://img.shields.io/badge/已收录-71条-673ab7.svg) [![版本](https://badgen.net/vs-marketplace/v/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![安装量](https://badgen.net/vs-marketplace/i/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![下载量](https://badgen.net/vs-marketplace/d/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) ![MIT](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://badgen.net/github/status/any86/any-rule/master/ci/circleci)](https://circleci.com/gh/any86/any-rule) 🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台 @@ -251,6 +251,11 @@ vscode应用商店中搜索"**any-rule**". /^\d{1,4}(-)(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31)$/ ``` +### 可以被moment转化成功的时间 YYYYMMDD HH:mm:ss +```javascript +/^\d{4}([/:-\S])(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31) (?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/ +``` + ### email(邮箱) ```javascript /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 4b5b0cb..f95b950 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -195,6 +195,12 @@ module.exports = [{ examples: ['1990-12-12', '1-1-1','0000-1-1'], counterExamples: ['2020-00-01'] }, +{ + title: '可以被moment转化成功的时间 YYYYMMDD HH:mm:ss', + rule: /^\d{4}([/:-\S])(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31) (?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/, + examples: ['2020/01/01 23:59:59','2020-01-01 00:00:00', '20200101 11:11:11'], + counterExamples: ['2020/00/01 23:59:59', '2020-01/01 23:59:59', '2020-01-01 23:59:61','2020-01-0100:00:00', ] +}, { title: 'email(邮箱)', rule: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, From 80f68ddec78ffce7340d6e93df7c418fbfd95fc3 Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Tue, 7 Sep 2021 17:20:02 +0800 Subject: [PATCH 02/28] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fbd82b2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Russell + +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. From 5f3887343ab212838914c6f658586404ae1ed816 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Sun, 26 Sep 2021 14:09:17 +0800 Subject: [PATCH 03/28] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=B0?= =?UTF-8?q?=E7=89=88vocode=E4=B8=AD"@zz"=E4=B8=8D=E8=83=BD=E5=94=A4?= =?UTF-8?q?=E8=B5=B7=E7=9A=84BUG(#195)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 7 ++++++- src/useQuickPick.ts | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b5dc67b..5bb9538 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,11 @@ "type": "string", "default": "@zz", "description": "触发字符串" + }, + "any-rule.supportedLanguages": { + "type": "string", + "default": "*,javascript,javascriptreact,typescript,typescriptreact,vue,vue-postcss,vue-sugarss,vue-html,json,jsonc,graphql,dart,sql,go,java,php,jade,python,swift,markdown", + "description": "支持的开发语言(用','分割)" } } }, @@ -368,4 +373,4 @@ "axios": "^0.19.2", "transliteration": "^2.1.8" } -} +} \ No newline at end of file diff --git a/src/useQuickPick.ts b/src/useQuickPick.ts index 435e103..b1ad7e7 100644 --- a/src/useQuickPick.ts +++ b/src/useQuickPick.ts @@ -87,16 +87,16 @@ function insertRule(document: TextDocument, position: Position, ruleString: stri // 获取配置 function getConfig() { const configuration = workspace.getConfiguration(); - const { triggerString } = configuration['any-rule']; + const { triggerString, supportedLanguages } = configuration['any-rule']; const { length } = triggerString; const triggerStringStart = triggerString.substr(0, length - 1); const triggerStringEnd = triggerString.substr(-1); - + console.log(supportedLanguages); return { triggerStringStart, triggerStringEnd, triggerString, // 预留 - supportedLanguages: '*' + supportedLanguages } } From 7d52471fd9bd542ec1880f58c28955bda9dc1497 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Sun, 26 Sep 2021 14:31:17 +0800 Subject: [PATCH 04/28] =?UTF-8?q?perf:=20=E8=BA=AB=E4=BB=BD=E8=AF=81?= =?UTF-8?q?=E4=B8=A5=E6=A0=BC=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E5=B9=B4=E4=BB=BD=E3=80=81=E6=9C=88=E4=BB=BD=E7=9A=84=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=EF=BC=8C=E6=94=AF=E6=8C=8115=EF=BC=8C18=E4=BD=8D?= =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AF=81(#190)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/RULES.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 4b5b0cb..df75a39 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -198,7 +198,7 @@ module.exports = [{ { title: 'email(邮箱)', rule: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, - examples: ['90203918@qq.com', 'nbilly@126.com'] + examples: ['90203918@qq.com', 'nbilly@126.com', '汉字@qq.com'] }, { @@ -219,8 +219,8 @@ module.exports = [{ }, { title: '身份证号, 支持1/2代(15位/18位数字)', - rule: /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, - examples: ['622223199912051311'] + rule: /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/, + examples: ['622223199912051311','12345619991205131x','123456991010193'] }, { title: '护照(包含香港、澳门)', From f83922b3636345d61bb8d23774e24609249e4de4 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Sun, 26 Sep 2021 14:33:10 +0800 Subject: [PATCH 05/28] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9faa38..5010ae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # 更新日志 🚀 [提交问题](https://github.com/any86/any-rule/issues/new) +### 0.3.11(2021-09-26) +- 修复新版vscode中"@zz"字符失效. +- 优化"身份证15/18"正则. + ### 0.3.10(2021-05-28) - 禁止"日期"可以通过"00"月和"00"日 ### 0.3.9(2021-04-20) From ec9371016ae84f51146d9f88646c25677b27f7ce Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Sun, 26 Sep 2021 14:50:07 +0800 Subject: [PATCH 06/28] 0.3.11 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0122cea..f118e5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "any-rule", - "version": "0.3.10", + "version": "0.3.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5bb9538..24c3664 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publisher": "russell", "displayName": "any-rule", "description": "你要的\"正则\"都在这!", - "version": "0.3.10", + "version": "0.3.11", "husky": { "hooks": { "pre-push": "npm run test:rules" @@ -373,4 +373,4 @@ "axios": "^0.19.2", "transliteration": "^2.1.8" } -} \ No newline at end of file +} From 1283e878594cee7e24edbcd0da2dd568e7e9f940 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Sun, 26 Sep 2021 14:50:42 +0800 Subject: [PATCH 07/28] v0.3.11 --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 75ebfe2..e06acb7 100644 --- a/README.md +++ b/README.md @@ -273,7 +273,7 @@ vscode应用商店中搜索"**any-rule**". ### 身份证号, 支持1/2代(15位/18位数字) ```javascript -/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/ +/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/ ``` ### 护照(包含香港、澳门) diff --git a/package.json b/package.json index 24c3664..b2689d3 100644 --- a/package.json +++ b/package.json @@ -373,4 +373,4 @@ "axios": "^0.19.2", "transliteration": "^2.1.8" } -} +} \ No newline at end of file From 9873f5db00ed5d7890ae3a32dd0d44fcec06c51e Mon Sep 17 00:00:00 2001 From: 383514580 <383514580@qq.com> Date: Mon, 27 Sep 2021 21:01:10 +0800 Subject: [PATCH 08/28] v0.3.11 --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 75ebfe2..e06acb7 100644 --- a/README.md +++ b/README.md @@ -273,7 +273,7 @@ vscode应用商店中搜索"**any-rule**". ### 身份证号, 支持1/2代(15位/18位数字) ```javascript -/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/ +/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/ ``` ### 护照(包含香港、澳门) diff --git a/package.json b/package.json index 24c3664..b2689d3 100644 --- a/package.json +++ b/package.json @@ -373,4 +373,4 @@ "axios": "^0.19.2", "transliteration": "^2.1.8" } -} +} \ No newline at end of file From 7807af68b76f0d9b026d0114e69e6539aa82c8c7 Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Fri, 1 Oct 2021 20:26:01 +0800 Subject: [PATCH 09/28] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9web?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/App.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/www/src/App.vue b/packages/www/src/App.vue index 16e3018..33cadda 100644 --- a/packages/www/src/App.vue +++ b/packages/www/src/App.vue @@ -376,7 +376,7 @@ main { color: #fff; font-size: 12px; cursor: pointer; - box-shadow: 1px 2px 3px 1px $primary; + box-shadow: 1px 2px 3px $primary; &.success { &:after { content: '复制成功'; @@ -391,20 +391,19 @@ main { } &:active { opacity: 0.6; - color: #444; + box-shadow: none; } &:hover { transition: all 0.3s; - opacity: 0.6; - box-shadow: none; + color: rgba(255, 255, 255, 0.6) } } > .btn-better { @extend .btn-copy; background-color: $danger; - box-shadow: 1px 2px 3px 1px $danger; + box-shadow: 1px 2px 3px $danger; } > code { From e0fcb8259beb5ed2d7ddbc899bbc2ad49807cc59 Mon Sep 17 00:00:00 2001 From: songjian <1778651752@qq.com> Date: Tue, 12 Oct 2021 17:48:26 +0800 Subject: [PATCH 10/28] feat: Increase number-related regular verification --- .gitignore | 9 ++++++++- packages/www/src/RULES.js | 30 +++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 5c378f9..36d4a33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,12 @@ out node_modules +coverage +.nyc_output .vscode-test/ +.idea +.vscode +.DS_Store *.vsix -yarn-error.log \ No newline at end of file +yarn-error.log +.rpt2_cache +dist diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 6132a4c..5bdc1ef 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -243,11 +243,6 @@ module.exports = [{ rule: /^\d+\.\d+$/, examples: ['0.0', '0.09'] }, -{ - title: '数字', - rule: /^\d{1,}$/, - examples: [12345678] -}, { title: 'html标签(宽松匹配)', rule: /<(\w+)[^>]*>(.*?<\/\1>)?/, @@ -358,4 +353,29 @@ module.exports = [{ rule: /^[a-zA-Z][0-9]{9}$/, examples: ['U193683453'] }, +{ + title: '数字', + rule: /^\d{1,}$/, + examples: [12345678] +}, +{ + title: '正整数,不包含0', + rule: /^\+?[1-9]\d*$/, + examples: [1231] +}, +{ + title: '负整数,不包含0', + rule: /^-[1-9]\d*$/, + examples: [-1231] +}, +{ + title: '整数', + rule: /^-?[0-9]\d*$/, + examples: [-1231, 123] +}, +{ + title: '浮点数', + rule: /^(-?\d+)(\.\d+)?$/, + examples: [1.5] +} ]; From df9a5ac291c29d6e741350d9fd80d28a3226507d Mon Sep 17 00:00:00 2001 From: songjian <1778651752@qq.com> Date: Wed, 13 Oct 2021 16:12:45 +0800 Subject: [PATCH 11/28] feat: Increase number-related regular verification --- README.md | 20 ++++++++++++++++++++ package.json | 16 ++++++++++++++++ packages/www/src/RULES.js | 10 +++++----- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bfd51fc..7a760af 100644 --- a/README.md +++ b/README.md @@ -410,3 +410,23 @@ vscode应用商店中搜索"**any-rule**". ```javascript /^[a-zA-Z][0-9]{9}$/ ``` + +### 正整数,不包含0 +```javascript +/^\+?[1-9]\d*$/ +``` + +### 负整数,不包含0 +```javascript +/^-[1-9]\d*$/ +``` + +### 整数 +```javascript +/^-?[0-9]\d*$/ +``` + +### 浮点数 +```javascript +/^(-?\d+)(\.\d+)?$/ +``` diff --git a/package.json b/package.json index b5dc67b..06f8780 100644 --- a/package.json +++ b/package.json @@ -341,6 +341,22 @@ "command": "extension.rule69", "title": "$(rocket) zz: 台湾身份证 " }, + { + "command": "extension.rule70", + "title": "$(rocket) zz: 正整数,不包含0 " + }, + { + "command": "extension.rule71", + "title": "$(rocket) zz: 负整数,不包含0 " + }, + { + "command": "extension.rule72", + "title": "$(rocket) zz: 整数 " + }, + { + "command": "extension.rule73", + "title": "$(rocket) zz: 浮点数 " + }, { "command": "extension.rule.callByMenu", "title": "🦕正则大全(70条)" diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 5bdc1ef..e69e81a 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -243,6 +243,11 @@ module.exports = [{ rule: /^\d+\.\d+$/, examples: ['0.0', '0.09'] }, +{ + title: '数字', + rule: /^\d{1,}$/, + examples: [12345678] +}, { title: 'html标签(宽松匹配)', rule: /<(\w+)[^>]*>(.*?<\/\1>)?/, @@ -353,11 +358,6 @@ module.exports = [{ rule: /^[a-zA-Z][0-9]{9}$/, examples: ['U193683453'] }, -{ - title: '数字', - rule: /^\d{1,}$/, - examples: [12345678] -}, { title: '正整数,不包含0', rule: /^\+?[1-9]\d*$/, From 44b733569e9e9316df46a7c932d16947df21648b Mon Sep 17 00:00:00 2001 From: songjian <1778651752@qq.com> Date: Tue, 19 Oct 2021 11:09:37 +0800 Subject: [PATCH 12/28] feat: add cEmail --- README.md | 5 +++++ package.json | 4 ++++ packages/www/src/RULES.js | 9 +++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7a760af..38527d4 100644 --- a/README.md +++ b/README.md @@ -430,3 +430,8 @@ vscode应用商店中搜索"**any-rule**". ```javascript /^(-?\d+)(\.\d+)?$/ ``` + +### email(支持中文邮箱) +```javascript +/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/ +``` diff --git a/package.json b/package.json index 06f8780..5a0eecc 100644 --- a/package.json +++ b/package.json @@ -357,6 +357,10 @@ "command": "extension.rule73", "title": "$(rocket) zz: 浮点数 " }, + { + "command": "extension.rule74", + "title": "$(rocket) zz: email(支持中文邮箱) " + }, { "command": "extension.rule.callByMenu", "title": "🦕正则大全(70条)" diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index e69e81a..930a06d 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -17,7 +17,7 @@ module.exports = [{ { 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'], + examples: ['www.qq.com', 'https://baidu.com', 'http://baidu.com', '360.com:8080/vue/#/a=1&b=2'], counterExamples: ['....'] }, { @@ -115,7 +115,7 @@ module.exports = [{ { title: '图片(image)链接地址(图片格式可按需增删)', rule: /^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i, - examples: ['https://www.abc.com/logo.png'] + examples: ['https://www.abc.com/logo.png', 'http://www.abc.com/logo.png'] }, { title: '24小时制时间(HH:mm:ss)', @@ -377,5 +377,10 @@ module.exports = [{ title: '浮点数', rule: /^(-?\d+)(\.\d+)?$/, examples: [1.5] +}, +{ + title: 'email(支持中文邮箱)', + rule: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, + examples: ['90203918@qq.com', 'nbilly@126.com', '啦啦啦@126.com'] } ]; From 4710be9ba98c04304069f6b4f0706124145c7d2f Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Wed, 20 Oct 2021 11:05:44 +0800 Subject: [PATCH 13/28] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=BD=91?= =?UTF-8?q?=E5=9D=80=E4=B8=8D=E8=83=BD=E5=B8=A6"()"(#202)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/RULES.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 930a06d..62f4ef0 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -16,8 +16,8 @@ module.exports = [{ }, { title: '网址(url,支持端口和"?+参数"和"#+参数)', - rule: /^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$/, - examples: ['www.qq.com', 'https://baidu.com', 'http://baidu.com', '360.com:8080/vue/#/a=1&b=2'], + rule: /^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-\(\)]*[\w@?^=%&/~+#-\(\)])?$/, + examples: ['www.qq.com', 'https://baidu.com', 'http://baidu.com', 'https://www.amap.com/search?id=BV10060895&city=420111&geoobj=113.207951%7C29.992557%7C115.785782%7C31.204369&query_type=IDQ&query=%E5%85%89%E8%B0%B7%E5%B9%BF%E5%9C%BA(%E5%9C%B0%E9%93%81%E7%AB%99)&zoom=10.15', '360.com:8080/vue/#/a=1&b=2'], counterExamples: ['....'] }, { @@ -192,7 +192,7 @@ module.exports = [{ { title: 'date(日期)', rule: /^\d{1,4}(-)(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31)$/, - examples: ['1990-12-12', '1-1-1','0000-1-1'], + examples: ['1990-12-12', '1-1-1', '0000-1-1'], counterExamples: ['2020-00-01'] }, { From 1ca32353d406fc77584c9b712d34133b29d38af8 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Wed, 20 Oct 2021 11:10:05 +0800 Subject: [PATCH 14/28] =?UTF-8?q?chore:=E6=9B=B4=E6=96=B0=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5010ae3..169ba5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # 更新日志 🚀 [提交问题](https://github.com/any86/any-rule/issues/new) +### 0.3.12(2021-10-20) +- 修复网址中带有"()"不能通过. +- 新增"整数"/"浮点数"等正则. + ### 0.3.11(2021-09-26) - 修复新版vscode中"@zz"字符失效. - 优化"身份证15/18"正则. From a499d000ad0f81fa4782f844208616f40f9bafb1 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Wed, 20 Oct 2021 11:18:35 +0800 Subject: [PATCH 15/28] 0.3.12 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f118e5c..e88ebe6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "any-rule", - "version": "0.3.11", + "version": "0.3.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 08d4ffd..c593fbe 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publisher": "russell", "displayName": "any-rule", "description": "你要的\"正则\"都在这!", - "version": "0.3.11", + "version": "0.3.12", "husky": { "hooks": { "pre-push": "npm run test:rules" @@ -393,4 +393,4 @@ "axios": "^0.19.2", "transliteration": "^2.1.8" } -} \ No newline at end of file +} From 8414a8e1aa78e83001c006cad57e21a7d39fd691 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Wed, 20 Oct 2021 11:21:51 +0800 Subject: [PATCH 16/28] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 126 +++++++++++++++++++++++++-------------------------- package.json | 14 +++--- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 9348c2d..1379fae 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,65 @@ -# 正则大全 ![已收录70条](https://img.shields.io/badge/已收录-70条-673ab7.svg) [![版本](https://badgen.net/vs-marketplace/v/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![安装量](https://badgen.net/vs-marketplace/i/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![下载量](https://badgen.net/vs-marketplace/d/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) ![MIT](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://badgen.net/github/status/any86/any-rule/master/ci/circleci)](https://circleci.com/gh/any86/any-rule) - -🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台 - -## :rocket:web版本 -https://any86.github.io/any-rule/ - -## 🍭vscode插件 - -### 安装 -vscode应用商店中搜索"**any-rule**". - -### 使用 -**方式1:** - -1. 按**F1**(mac下fn+F1)打开正则列表. -2. **输入关键词搜索**, 比如"手机". - -![预览图](https://user-gold-cdn.xitu.io/2020/1/10/16f8e01a684a0a18?w=420&h=243&f=gif&s=414162) - -**方式2:** - -右键选择"🦕正则大全". - -![](https://user-gold-cdn.xitu.io/2020/2/28/17087735718cca3b?w=389&h=400&f=png&s=55934) - -**方式3:** - -在代码任意位置输入"**@zz**". - - -![预览图](https://user-gold-cdn.xitu.io/2020/2/28/17089999afc7a21c?w=722&h=408&f=gif&s=299355) - -## 👩‍🏫图解正则 -
-查看详情 -每次在any-rule中选择正则后会弹出提示, 可点击"🤖图解正则". - -![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e32c3a6fb116?w=533&h=95&f=png&s=21563) - -点击后可以看到正则解析, 方便大家学习. - -![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e349b600c28b?w=1151&h=500&f=png&s=45210) - -**注意**: 图解直接使用了https://regexper.com, 在此对作者表示敬意和感谢. -
- -## 社区版本 -[idea版](https://github.com/zhoriya/idea-rule) - -[Alfred Workflow版](https://github.com/cccyb/workflows) - -## :fire:关于PR -欢迎大家PR, 步骤如下: -1. **正则**请在**packages/www/src/RULES.js**中添加. -2. 运行`npm run test:rules`进行测试. -3. 运行`npm run build:md`更新**README.md**. -4. 请务必提交到**develop**分支. - -在此感谢大家对**any-rule**做出的贡献! - -## 🍔正则 +# 正则大全 ![已收录75条](https://img.shields.io/badge/已收录-75条-673ab7.svg) [![版本](https://badgen.net/vs-marketplace/v/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![安装量](https://badgen.net/vs-marketplace/i/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![下载量](https://badgen.net/vs-marketplace/d/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) ![MIT](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://badgen.net/github/status/any86/any-rule/master/ci/circleci)](https://circleci.com/gh/any86/any-rule) + +🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台 + +## :rocket:web版本 +https://any86.github.io/any-rule/ + +## 🍭vscode插件 + +### 安装 +vscode应用商店中搜索"**any-rule**". + +### 使用 +**方式1:** + +1. 按**F1**(mac下fn+F1)打开正则列表. +2. **输入关键词搜索**, 比如"手机". + +![预览图](https://user-gold-cdn.xitu.io/2020/1/10/16f8e01a684a0a18?w=420&h=243&f=gif&s=414162) + +**方式2:** + +右键选择"🦕正则大全". + +![](https://user-gold-cdn.xitu.io/2020/2/28/17087735718cca3b?w=389&h=400&f=png&s=55934) + +**方式3:** + +在代码任意位置输入"**@zz**". + + +![预览图](https://user-gold-cdn.xitu.io/2020/2/28/17089999afc7a21c?w=722&h=408&f=gif&s=299355) + +## 👩‍🏫图解正则 +
+查看详情 +每次在any-rule中选择正则后会弹出提示, 可点击"🤖图解正则". + +![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e32c3a6fb116?w=533&h=95&f=png&s=21563) + +点击后可以看到正则解析, 方便大家学习. + +![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e349b600c28b?w=1151&h=500&f=png&s=45210) + +**注意**: 图解直接使用了https://regexper.com, 在此对作者表示敬意和感谢. +
+ +## 社区版本 +[idea版](https://github.com/zhoriya/idea-rule) + +[Alfred Workflow版](https://github.com/cccyb/workflows) + +## :fire:关于PR +欢迎大家PR, 步骤如下: +1. **正则**请在**packages/www/src/RULES.js**中添加. +2. 运行`npm run test:rules`进行测试. +3. 运行`npm run build:md`更新**README.md**. +4. 请务必提交到**develop**分支. + +在此感谢大家对**any-rule**做出的贡献! + +## 🍔正则 ### 火车车次 ```javascript @@ -78,7 +78,7 @@ vscode应用商店中搜索"**any-rule**". ### 网址(url,支持端口和"?+参数"和"#+参数) ```javascript -/^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$/ +/^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-\(\)]*[\w@?^=%&/~+#-\(\)])?$/ ``` ### 统一社会信用代码 diff --git a/package.json b/package.json index c593fbe..7f45bc8 100644 --- a/package.json +++ b/package.json @@ -348,27 +348,27 @@ }, { "command": "extension.rule70", - "title": "$(rocket) zz: 正整数,不包含0 " + "title": "$(rocket) zz: 正整数,不包含0" }, { "command": "extension.rule71", - "title": "$(rocket) zz: 负整数,不包含0 " + "title": "$(rocket) zz: 负整数,不包含0" }, { "command": "extension.rule72", - "title": "$(rocket) zz: 整数 " + "title": "$(rocket) zz: 整数" }, { "command": "extension.rule73", - "title": "$(rocket) zz: 浮点数 " + "title": "$(rocket) zz: 浮点数" }, { "command": "extension.rule74", - "title": "$(rocket) zz: email(支持中文邮箱) " + "title": "$(rocket) zz: email(支持中文邮箱)" }, { "command": "extension.rule.callByMenu", - "title": "🦕正则大全(70条)" + "title": "🦕正则大全(75条)" } ] }, @@ -393,4 +393,4 @@ "axios": "^0.19.2", "transliteration": "^2.1.8" } -} +} \ No newline at end of file From 26220db48ad782439b87ca00175dabfb4cbca5bd Mon Sep 17 00:00:00 2001 From: xiaocaiji <50451924+2462870727@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:57:24 +0800 Subject: [PATCH 17/28] Update RULES.js --- packages/www/src/RULES.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 4b5b0cb..8e6fee2 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -358,4 +358,9 @@ module.exports = [{ rule: /^[a-zA-Z][0-9]{9}$/, examples: ['U193683453'] }, +{ + title: '复杂密码', + rule: /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/, + example: ['a1@','A1@','Aa@'] +} ]; From cd141a9472dcd28a239126a7889b0722f78db0a8 Mon Sep 17 00:00:00 2001 From: xiaocaiji <50451924+2462870727@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:02:08 +0800 Subject: [PATCH 18/28] Update README.md --- README.md | 130 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 68 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 75ebfe2..776c5ba 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,65 @@ -# 正则大全 ![已收录70条](https://img.shields.io/badge/已收录-70条-673ab7.svg) [![版本](https://badgen.net/vs-marketplace/v/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![安装量](https://badgen.net/vs-marketplace/i/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![下载量](https://badgen.net/vs-marketplace/d/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) ![MIT](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://badgen.net/github/status/any86/any-rule/master/ci/circleci)](https://circleci.com/gh/any86/any-rule) - -🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台 - -## :rocket:web版本 -https://any86.github.io/any-rule/ - -## 🍭vscode插件 - -### 安装 -vscode应用商店中搜索"**any-rule**". - -### 使用 -**方式1:** - -1. 按**F1**(mac下fn+F1)打开正则列表. -2. **输入关键词搜索**, 比如"手机". - -![预览图](https://user-gold-cdn.xitu.io/2020/1/10/16f8e01a684a0a18?w=420&h=243&f=gif&s=414162) - -**方式2:** - -右键选择"🦕正则大全". - -![](https://user-gold-cdn.xitu.io/2020/2/28/17087735718cca3b?w=389&h=400&f=png&s=55934) - -**方式3:** - -在代码任意位置输入"**@zz**". - - -![预览图](https://user-gold-cdn.xitu.io/2020/2/28/17089999afc7a21c?w=722&h=408&f=gif&s=299355) - -## 👩‍🏫图解正则 -
-查看详情 -每次在any-rule中选择正则后会弹出提示, 可点击"🤖图解正则". - -![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e32c3a6fb116?w=533&h=95&f=png&s=21563) - -点击后可以看到正则解析, 方便大家学习. - -![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e349b600c28b?w=1151&h=500&f=png&s=45210) - -**注意**: 图解直接使用了https://regexper.com, 在此对作者表示敬意和感谢. -
- -## 社区版本 -[idea版](https://github.com/zhoriya/idea-rule) - -[Alfred Workflow版](https://github.com/cccyb/workflows) - -## :fire:关于PR -欢迎大家PR, 步骤如下: -1. **正则**请在**packages/www/src/RULES.js**中添加. -2. 运行`npm run test:rules`进行测试. -3. 运行`npm run build:md`更新**README.md**. -4. 请务必提交到**develop**分支. - -在此感谢大家对**any-rule**做出的贡献! - -## 🍔正则 +# 正则大全 ![已收录70条](https://img.shields.io/badge/已收录-70条-673ab7.svg) [![版本](https://badgen.net/vs-marketplace/v/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![安装量](https://badgen.net/vs-marketplace/i/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![下载量](https://badgen.net/vs-marketplace/d/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) ![MIT](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://badgen.net/github/status/any86/any-rule/master/ci/circleci)](https://circleci.com/gh/any86/any-rule) + +🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台 + +## :rocket:web版本 +https://any86.github.io/any-rule/ + +## 🍭vscode插件 + +### 安装 +vscode应用商店中搜索"**any-rule**". + +### 使用 +**方式1:** + +1. 按**F1**(mac下fn+F1)打开正则列表. +2. **输入关键词搜索**, 比如"手机". + +![预览图](https://user-gold-cdn.xitu.io/2020/1/10/16f8e01a684a0a18?w=420&h=243&f=gif&s=414162) + +**方式2:** + +右键选择"🦕正则大全". + +![](https://user-gold-cdn.xitu.io/2020/2/28/17087735718cca3b?w=389&h=400&f=png&s=55934) + +**方式3:** + +在代码任意位置输入"**@zz**". + + +![预览图](https://user-gold-cdn.xitu.io/2020/2/28/17089999afc7a21c?w=722&h=408&f=gif&s=299355) + +## 👩‍🏫图解正则 +
+查看详情 +每次在any-rule中选择正则后会弹出提示, 可点击"🤖图解正则". + +![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e32c3a6fb116?w=533&h=95&f=png&s=21563) + +点击后可以看到正则解析, 方便大家学习. + +![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e349b600c28b?w=1151&h=500&f=png&s=45210) + +**注意**: 图解直接使用了https://regexper.com, 在此对作者表示敬意和感谢. +
+ +## 社区版本 +[idea版](https://github.com/zhoriya/idea-rule) + +[Alfred Workflow版](https://github.com/cccyb/workflows) + +## :fire:关于PR +欢迎大家PR, 步骤如下: +1. **正则**请在**packages/www/src/RULES.js**中添加. +2. 运行`npm run test:rules`进行测试. +3. 运行`npm run build:md`更新**README.md**. +4. 请务必提交到**develop**分支. + +在此感谢大家对**any-rule**做出的贡献! + +## 🍔正则 ### 火车车次 ```javascript @@ -410,3 +410,9 @@ vscode应用商店中搜索"**any-rule**". ```javascript /^[a-zA-Z][0-9]{9}$/ ``` + +### 复杂密码 +```javascript +export const PASSWORD = /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/ + +``` From d9b00b4483029d284f9f7351687bc066d4040fa4 Mon Sep 17 00:00:00 2001 From: xiaocaiji <50451924+2462870727@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:04:14 +0800 Subject: [PATCH 19/28] Update RULES.js --- packages/www/src/RULES.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 8e6fee2..f0ab5e7 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -359,7 +359,7 @@ module.exports = [{ examples: ['U193683453'] }, { - title: '复杂密码', + title: '大写字母,小写字母,数字,特殊符号 `@#$%^&*`~()-+=` 中任意3项密码', rule: /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/, example: ['a1@','A1@','Aa@'] } From aff19cbcab95b541ad47a2354b12334ce556232d Mon Sep 17 00:00:00 2001 From: xiaocaiji <50451924+2462870727@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:04:50 +0800 Subject: [PATCH 20/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 776c5ba..db7400d 100644 --- a/README.md +++ b/README.md @@ -413,6 +413,6 @@ vscode应用商店中搜索"**any-rule**". ### 复杂密码 ```javascript -export const PASSWORD = /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/ +/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/ ``` From f419267072d00725dbbb08ffd513a26f9e18d49f Mon Sep 17 00:00:00 2001 From: xiaocaiji <50451924+2462870727@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:05:33 +0800 Subject: [PATCH 21/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db7400d..d8b9e42 100644 --- a/README.md +++ b/README.md @@ -411,7 +411,7 @@ vscode应用商店中搜索"**any-rule**". /^[a-zA-Z][0-9]{9}$/ ``` -### 复杂密码 +### 大写字母,小写字母,数字,特殊符号 `@#$%^&*`~()-+=` 中任意3项密码 ```javascript /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/ From 7a0d7a32a9f075bbd672b0a57fca73caa9330b5a Mon Sep 17 00:00:00 2001 From: xiaocaiji <50451924+2462870727@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:47:15 +0800 Subject: [PATCH 22/28] Update RULES.js --- packages/www/src/RULES.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index f0ab5e7..d52d98d 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -361,6 +361,6 @@ module.exports = [{ { title: '大写字母,小写字母,数字,特殊符号 `@#$%^&*`~()-+=` 中任意3项密码', rule: /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/, - example: ['a1@','A1@','Aa@'] + examples: ['a1@','A1@','Aa@'] } ]; From 89083d14a62e98dd7bd408c5292648a2028f9b10 Mon Sep 17 00:00:00 2001 From: "2462870727@qq.com" <2462870727@qq.com> Date: Wed, 20 Oct 2021 21:15:46 +0800 Subject: [PATCH 23/28] =?UTF-8?q?update=20=E5=A4=8D=E6=9D=82=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 125 +++++++++++++++++++++++++++--------------------------- 1 file changed, 62 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index d8b9e42..7f1d22c 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,65 @@ -# 正则大全 ![已收录70条](https://img.shields.io/badge/已收录-70条-673ab7.svg) [![版本](https://badgen.net/vs-marketplace/v/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![安装量](https://badgen.net/vs-marketplace/i/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![下载量](https://badgen.net/vs-marketplace/d/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) ![MIT](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://badgen.net/github/status/any86/any-rule/master/ci/circleci)](https://circleci.com/gh/any86/any-rule) - -🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台 - -## :rocket:web版本 -https://any86.github.io/any-rule/ - -## 🍭vscode插件 - -### 安装 -vscode应用商店中搜索"**any-rule**". - -### 使用 -**方式1:** - -1. 按**F1**(mac下fn+F1)打开正则列表. -2. **输入关键词搜索**, 比如"手机". - -![预览图](https://user-gold-cdn.xitu.io/2020/1/10/16f8e01a684a0a18?w=420&h=243&f=gif&s=414162) - -**方式2:** - -右键选择"🦕正则大全". - -![](https://user-gold-cdn.xitu.io/2020/2/28/17087735718cca3b?w=389&h=400&f=png&s=55934) - -**方式3:** - -在代码任意位置输入"**@zz**". - - -![预览图](https://user-gold-cdn.xitu.io/2020/2/28/17089999afc7a21c?w=722&h=408&f=gif&s=299355) - -## 👩‍🏫图解正则 -
-查看详情 -每次在any-rule中选择正则后会弹出提示, 可点击"🤖图解正则". - -![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e32c3a6fb116?w=533&h=95&f=png&s=21563) - -点击后可以看到正则解析, 方便大家学习. - -![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e349b600c28b?w=1151&h=500&f=png&s=45210) - -**注意**: 图解直接使用了https://regexper.com, 在此对作者表示敬意和感谢. -
- -## 社区版本 -[idea版](https://github.com/zhoriya/idea-rule) - -[Alfred Workflow版](https://github.com/cccyb/workflows) - -## :fire:关于PR -欢迎大家PR, 步骤如下: -1. **正则**请在**packages/www/src/RULES.js**中添加. -2. 运行`npm run test:rules`进行测试. -3. 运行`npm run build:md`更新**README.md**. -4. 请务必提交到**develop**分支. - -在此感谢大家对**any-rule**做出的贡献! - -## 🍔正则 +# 正则大全 ![已收录71条](https://img.shields.io/badge/已收录-71条-673ab7.svg) [![版本](https://badgen.net/vs-marketplace/v/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![安装量](https://badgen.net/vs-marketplace/i/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) [![下载量](https://badgen.net/vs-marketplace/d/russell.any-rule)](https://marketplace.visualstudio.com/items?itemName=russell.any-rule) ![MIT](https://img.shields.io/badge/license-MIT-F44336.svg) [![CircleCI](https://badgen.net/github/status/any86/any-rule/master/ci/circleci)](https://circleci.com/gh/any86/any-rule) + +🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台 + +## :rocket:web版本 +https://any86.github.io/any-rule/ + +## 🍭vscode插件 + +### 安装 +vscode应用商店中搜索"**any-rule**". + +### 使用 +**方式1:** + +1. 按**F1**(mac下fn+F1)打开正则列表. +2. **输入关键词搜索**, 比如"手机". + +![预览图](https://user-gold-cdn.xitu.io/2020/1/10/16f8e01a684a0a18?w=420&h=243&f=gif&s=414162) + +**方式2:** + +右键选择"🦕正则大全". + +![](https://user-gold-cdn.xitu.io/2020/2/28/17087735718cca3b?w=389&h=400&f=png&s=55934) + +**方式3:** + +在代码任意位置输入"**@zz**". + + +![预览图](https://user-gold-cdn.xitu.io/2020/2/28/17089999afc7a21c?w=722&h=408&f=gif&s=299355) + +## 👩‍🏫图解正则 +
+查看详情 +每次在any-rule中选择正则后会弹出提示, 可点击"🤖图解正则". + +![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e32c3a6fb116?w=533&h=95&f=png&s=21563) + +点击后可以看到正则解析, 方便大家学习. + +![预览图](https://user-gold-cdn.xitu.io/2020/2/23/1706e349b600c28b?w=1151&h=500&f=png&s=45210) + +**注意**: 图解直接使用了https://regexper.com, 在此对作者表示敬意和感谢. +
+ +## 社区版本 +[idea版](https://github.com/zhoriya/idea-rule) + +[Alfred Workflow版](https://github.com/cccyb/workflows) + +## :fire:关于PR +欢迎大家PR, 步骤如下: +1. **正则**请在**packages/www/src/RULES.js**中添加. +2. 运行`npm run test:rules`进行测试. +3. 运行`npm run build:md`更新**README.md**. +4. 请务必提交到**develop**分支. + +在此感谢大家对**any-rule**做出的贡献! + +## 🍔正则 ### 火车车次 ```javascript @@ -414,5 +414,4 @@ vscode应用商店中搜索"**any-rule**". ### 大写字母,小写字母,数字,特殊符号 `@#$%^&*`~()-+=` 中任意3项密码 ```javascript /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/ - ``` From 35256d81dd44d628f0370f092c5cdae5b4f05288 Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Wed, 20 Oct 2021 22:43:58 +0800 Subject: [PATCH 24/28] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9json=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/RULES.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index f65d190..31dade9 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -220,7 +220,7 @@ module.exports = [{ { title: '身份证号, 支持1/2代(15位/18位数字)', rule: /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/, - examples: ['622223199912051311','12345619991205131x','123456991010193'] + examples: ['622223199912051311', '12345619991205131x', '123456991010193'] }, { title: '护照(包含香港、澳门)', @@ -362,8 +362,8 @@ module.exports = [{ title: '大写字母,小写字母,数字,特殊符号 `@#$%^&*`~()-+=` 中任意3项密码', rule: /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/, - examples: ['a1@','A1@','Aa@'] -}, + examples: ['a1@', 'A1@', 'Aa@'] +}, { title: '正整数,不包含0', rule: /^\+?[1-9]\d*$/, examples: [1231] From 57ef9be087024e2d1a60c8dc83890a815cf23ce7 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Fri, 29 Oct 2021 10:29:43 +0800 Subject: [PATCH 25/28] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96ipv6=E6=AD=A3?= =?UTF-8?q?=E5=88=99(#189)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/RULES.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 31dade9..f7ad347 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -295,7 +295,7 @@ module.exports = [{ }, { title: 'ip-v6[:端口]', - rule: /^(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))|\[(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))\](?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$/i, + rule: /(^(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$)|(^\[(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))\](?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$)/i, examples: ['2031:0000:130f:0000:0000:09c0:876a:130b', '[2031:0000:130f:0000:0000:09c0:876a:130b]:8080'] }, { From 8280758a03cab4a6f28105369ba41f275bb94ec1 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Mon, 20 Dec 2021 11:30:37 +0800 Subject: [PATCH 26/28] =?UTF-8?q?fix:=20=E5=8F=82=E8=80=83=E7=99=BE?= =?UTF-8?q?=E5=BA=A6=E7=99=BE=E7=A7=91=E5=92=8C"chrome=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=A0=8F",=20=E4=BF=AE=E6=94=B9URL=E7=9A=84=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E8=A7=84=E5=88=99(#175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/RULES.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index f7ad347..576d765 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -15,9 +15,13 @@ module.exports = [{ counterExamples: ['192.168.1.1', 'https://www.jd.com'] }, { - title: '网址(url,支持端口和"?+参数"和"#+参数)', - rule: /^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-\(\)]*[\w@?^=%&/~+#-\(\)])?$/, - examples: ['www.qq.com', 'https://baidu.com', 'http://baidu.com', 'https://www.amap.com/search?id=BV10060895&city=420111&geoobj=113.207951%7C29.992557%7C115.785782%7C31.204369&query_type=IDQ&query=%E5%85%89%E8%B0%B7%E5%B9%BF%E5%9C%BA(%E5%9C%B0%E9%93%81%E7%AB%99)&zoom=10.15', '360.com:8080/vue/#/a=1&b=2'], + // 参考: + // https://baike.baidu.com/item/%E9%A1%B6%E7%BA%A7%E5%9F%9F%E5%90%8D#4_1 + // https://baike.baidu.com/item/%E9%A1%B6%E7%BA%A7%E5%9F%9F%E5%90%8D#7 + // 也参考谷歌浏览器的地址栏, 如果输入非字母不会被识别为域名 + title: '网址(URL)', + rule: /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/, + examples: ['www.qq.com', 'www.qq.99', '//www.qq.com', 'www.腾讯.cs', 'ftp://baidu.qq', 'http://baidu.com', 'https://www.amap.com/search?id=BV10060895&city=420111&geoobj=113.207951%7C29.992557%7C115.785782%7C31.204369&query_type=IDQ&query=%E5%85%89%E8%B0%B7%E5%B9%BF%E5%9C%BA(%E5%9C%B0%E9%93%81%E7%AB%99)&zoom=10.15', '360.com:8080/vue/#/a=1&b=2'], counterExamples: ['....'] }, { From 86b6af24c906d8a8d2e3d639e323d8adaca47c3e Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Mon, 20 Dec 2021 14:19:18 +0800 Subject: [PATCH 27/28] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3"=E6=BE=B3?= =?UTF-8?q?=E9=97=A8=E8=BA=AB=E4=BB=BD=E8=AF=81"(#210)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/RULES.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 576d765..dab4405 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -64,7 +64,7 @@ module.exports = [{ { title: 'linux文件夹路径', rule: /^\/(?:[^/]+\/)*$/, - examples: ['/usr/ad/dd/', '/', '/root/'] + examples: ['/usr/ad/dd/', '/', '/root/', '/ a a / a / a a /'] }, { title: 'linux文件路径', @@ -353,8 +353,10 @@ module.exports = [{ examples: ['K034169(1)'] }, { + // 参考: + // https://baike.baidu.com/item/%E6%BE%B3%E9%97%A8%E5%B1%85%E6%B0%91%E8%BA%AB%E4%BB%BD%E8%AF%81/12509098?fr=aladdin#5 title: '澳门身份证 ', - rule: /^[1|5|7]\d{6}[(\d)]{3}$/, + rule: /^[1|5|7]\d{6}\(\d\)$/, examples: ['5686611(1)'] }, { From 77509e77e641ea2b950d8392401b210ff5ee3205 Mon Sep 17 00:00:00 2001 From: Russell <383514580@qq.com> Date: Mon, 20 Dec 2021 14:23:14 +0800 Subject: [PATCH 28/28] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B(#207)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/RULES.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index dab4405..bf61ac7 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -21,7 +21,7 @@ module.exports = [{ // 也参考谷歌浏览器的地址栏, 如果输入非字母不会被识别为域名 title: '网址(URL)', rule: /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/, - examples: ['www.qq.com', 'www.qq.99', '//www.qq.com', 'www.腾讯.cs', 'ftp://baidu.qq', 'http://baidu.com', 'https://www.amap.com/search?id=BV10060895&city=420111&geoobj=113.207951%7C29.992557%7C115.785782%7C31.204369&query_type=IDQ&query=%E5%85%89%E8%B0%B7%E5%B9%BF%E5%9C%BA(%E5%9C%B0%E9%93%81%E7%AB%99)&zoom=10.15', '360.com:8080/vue/#/a=1&b=2'], + examples: ['www.qq.com','https://vuejs.org/v2/api/#v-model', 'www.qq.99', '//www.qq.com', 'www.腾讯.cs', 'ftp://baidu.qq', 'http://baidu.com', 'https://www.amap.com/search?id=BV10060895&city=420111&geoobj=113.207951%7C29.992557%7C115.785782%7C31.204369&query_type=IDQ&query=%E5%85%89%E8%B0%B7%E5%B9%BF%E5%9C%BA(%E5%9C%B0%E9%93%81%E7%AB%99)&zoom=10.15', '360.com:8080/vue/#/a=1&b=2'], counterExamples: ['....'] }, {