From b5d4dea6e77919918dc2852a62e2595e0b7f5d56 Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Wed, 10 Jun 2020 10:45:38 +0800 Subject: [PATCH 1/7] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- packages/www/src/RULES.js | 2 +- scripts/md.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4a07325..8b54e79 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ vscode应用商店中搜索"**any-rule**". ## 社区版本 -[idea版](https://github.com/zhoriya) +[idea版](https://github.com/zhoriya/idea-rule) [Alfred Workflow版](https://github.com/cccyb/workflows) @@ -262,7 +262,7 @@ vscode应用商店中搜索"**any-rule**". ### 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,}))$/ +/^(([^<>()[\]\\.,;:\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,}))$/ ``` ### 座机(tel phone)电话(国内),如: 0341-86091234 diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index 34802eb..d81adb6 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -186,7 +186,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,}))$/, + 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'] }, { diff --git a/scripts/md.js b/scripts/md.js index 66879f2..34dfe6f 100644 --- a/scripts/md.js +++ b/scripts/md.js @@ -70,7 +70,7 @@ vscode应用商店中搜索"**any-rule**". ## 社区版本 -[idea版](https://github.com/zhoriya) +[idea版](https://github.com/zhoriya/idea-rule) [Alfred Workflow版](https://github.com/cccyb/workflows) From 925765b36c702d0c5a0e2d5041fe1fa021c38447 Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Sun, 14 Jun 2020 08:51:56 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3'=E8=BD=A6?= =?UTF-8?q?=E7=89=8C=E5=8F=B7(=E6=96=B0=E8=83=BD=E6=BA=90+=E9=9D=9E?= =?UTF-8?q?=E6=96=B0=E8=83=BD=E6=BA=90)'=E6=9C=AA=E5=AF=B9=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E8=BF=9B=E8=A1=8C=E9=99=90=E5=88=B6(#107)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/www/src/RULES.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/www/src/RULES.js b/packages/www/src/RULES.js index d81adb6..6c11adc 100644 --- a/packages/www/src/RULES.js +++ b/packages/www/src/RULES.js @@ -56,12 +56,12 @@ module.exports = [{ { title: 'linux文件夹路径', rule: /^\/(?:[^/]+\/)*$/, - examples: ['/usr/ad/dd/', '/','/root/'] + examples: ['/usr/ad/dd/', '/', '/root/'] }, { title: 'linux文件路径', rule: /^\/(?:[^/]+\/)*[^/]+$/, - examples: ['/root/b.ts','/root/abc'] + examples: ['/root/b.ts', '/root/abc'] }, { title: 'window"文件夹"路径', @@ -161,8 +161,9 @@ module.exports = [{ }, { title: '车牌号(新能源+非新能源)', - 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})$/, - examples: ['京A12345D', '京A00599'] + 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})$/, + examples: ['京A12345D', '京A00599'], + counterExamples: ['宁AD1234555555'] }, { title: '手机号(mobile phone)中国(严谨), 根据工信部2019年最新公布的手机号段', @@ -318,11 +319,11 @@ module.exports = [{ { title: 'mac地址', rule: /^((([a-f0-9]{2}:){5})|(([a-f0-9]{2}-){5}))[a-f0-9]{2}$/i, - examples: ['38:f9:d3:4b:f5:51','00-0C-29-CA-E4-66'] + examples: ['38:f9:d3:4b:f5:51', '00-0C-29-CA-E4-66'] }, { title: '匹配连续重复的字符', rule: /(.)\1+/, - examples: ['我我我','112233','11234'] - } -]; + examples: ['我我我', '112233', '11234'] + } +]; \ No newline at end of file From 6d3e459fdc5017529229b17a41837be4ffb42d2e Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Sun, 14 Jun 2020 09:38:26 +0800 Subject: [PATCH 3/7] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E9=92=A9?= =?UTF-8?q?=E5=AD=90,=20=E6=8F=90=E4=BA=A4=E5=86=85=E5=AE=B9=E7=9A=84?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=8F=90=E4=BA=A4=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a77a64d..06af9a2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "version": "0.3.3", "husky": { "hooks": { - "pre-push": "npm run test:rules && npm run build:md && git add README.md" + "pre-push": "npm run test:rules && npm run build:md && git add README.md && git commit -m 'docs: 更新文档'" } }, "scripts": { From d983a759bf234d692b9f84e31de8f82634e16762 Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Sun, 14 Jun 2020 09:38:44 +0800 Subject: [PATCH 4/7] =?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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b54e79..970fb95 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,7 @@ vscode应用商店中搜索"**any-rule**". ### 车牌号(新能源+非新能源) ```javascript -/^(?:[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领 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})$/ +/^(?:[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领 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})$/ ``` ### 手机号(mobile phone)中国(严谨), 根据工信部2019年最新公布的手机号段 From d85a49e2640798c21f1677e258b22e50e4149a22 Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Sun, 14 Jun 2020 09:43:48 +0800 Subject: [PATCH 5/7] =?UTF-8?q?chore:=20=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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c4dd2e..2856f3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ # 更新日志 🚀 [提交问题](https://github.com/any86/any-rule/issues/new) +### 0.3.4(2020-06-14) +- 修正"车牌号(新能源+非新能源)"未对长度进行限制. +- 修正"身份证"中月份可以匹配00月的bug. +- 新增"匹配连续重复的字符"正则. +- 修正座机支持4位区号,8位电话号. +- 修正, 根据用户需求, "qq@qq"样式的email邮箱地址不再通过验证. + ### 0.3.3(2020-04-28) - 优化增加"身份证中日期的约束". - 优化"html注释|座机|密码"等正则. From 12b872668a735ed89708d05016b654dc3216b7e0 Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Sun, 14 Jun 2020 09:45:00 +0800 Subject: [PATCH 6/7] 0.3.4 --- 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 e44e810..17e80d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "any-rule", - "version": "0.3.3", + "version": "0.3.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 06af9a2..09c70c5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publisher": "russell", "displayName": "any-rule", "description": "你要的\"正则\"都在这!", - "version": "0.3.3", + "version": "0.3.4", "husky": { "hooks": { "pre-push": "npm run test:rules && npm run build:md && git add README.md && git commit -m 'docs: 更新文档'" @@ -340,4 +340,4 @@ "axios": "^0.19.2", "transliteration": "^2.1.8" } -} \ No newline at end of file +} From b313517b61ba1a3a475473bf7ce8bd435d12595a Mon Sep 17 00:00:00 2001 From: any86 <383514580@qq.com> Date: Sun, 14 Jun 2020 09:47:30 +0800 Subject: [PATCH 7/7] =?UTF-8?q?chore:=20=E5=8F=91=E5=B8=830.3.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 09c70c5..a2a4284 100644 --- a/package.json +++ b/package.json @@ -313,9 +313,13 @@ "command": "extension.rule62", "title": "$(rocket) zz: mac地址" }, + { + "command": "extension.rule63", + "title": "$(rocket) zz: 匹配连续重复的字符" + }, { "command": "extension.rule.callByMenu", - "title": "🦕正则大全(63条)" + "title": "🦕正则大全(64条)" } ] }, @@ -340,4 +344,4 @@ "axios": "^0.19.2", "transliteration": "^2.1.8" } -} +} \ No newline at end of file