From 2f10bbc61db399d6b56d7cea5f21d60e89cfdf90 Mon Sep 17 00:00:00 2001 From: 383514580 <383514580@qq.com> Date: Wed, 10 Jul 2019 23:15:51 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=96=87=E6=A1=A3=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=94=B6=E5=BD=95=E6=9D=A1=E6=95=B0=E5=92=8C=E5=BC=80?= =?UTF-8?q?=E6=BA=90=E8=AE=B8=E5=8F=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++++--- scripts/md.js | 6 ++++-- src/RULES.js | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 28eea05..a52e839 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -# 正则大全 -图形界面: https://any86.github.io/any-rule/ +# 正则大全 ![](https://img.shields.io/badge/已收录-44条-4caf50.svg) ![](https://img.shields.io/badge/license-MIT-F44336.svg) +:whale:图形界面: https://any86.github.io/any-rule/ + ## html注释 ```javascript @@ -103,7 +104,7 @@ ## email地址 ```javascript -/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/ +/^[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 diff --git a/scripts/md.js b/scripts/md.js index 36b17eb..3780f22 100644 --- a/scripts/md.js +++ b/scripts/md.js @@ -1,8 +1,10 @@ const fs = require('fs'); const chalk = require('chalk'); const json = require('../src/RULES.js'); -let content = `# 正则大全 -图形界面: https://any86.github.io/any-rule/\r\n`; +let content = `# 正则大全 ![](https://img.shields.io/badge/已收录-${json.length}条-4caf50.svg) ![](https://img.shields.io/badge/license-MIT-F44336.svg) +:whale:图形界面: https://any86.github.io/any-rule/\r\n +`; + json.forEach(({title, rule})=>{ content+= `\r\n## ${title}\r\n`; content+= `\`\`\`javascript\r\n`; diff --git a/src/RULES.js b/src/RULES.js index 6838650..01a72af 100644 --- a/src/RULES.js +++ b/src/RULES.js @@ -102,7 +102,7 @@ module.exports = [ }, { title: 'email地址', - rule: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/, + 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])?)*$/, example: '如: 90203918@qq.com、nbilly@126.com' }, {