Skip to content

Commit

Permalink
feat: 增加"统一社会信用代码"正则(any86#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
any86 committed Nov 7, 2019
1 parent d61a18c commit d3dd1a2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
25 changes: 15 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
# 更新日志
🚀 提交问题: https://github.com/any86/any-rule/issues/new

- 0.0.11
- [x] 增加"统一社会信用代码"正则

- 0.0.10
1. 迅雷正则增加thunderx规则的支持
- [x] 迅雷正则增加thunderx规则的支持

- 0.0.9
1. 修复"ed2k"正则错误
- [x] 修复"ed2k"正则错误

- 0.0.8
1. 优化车牌号正则
- [x] 优化车牌号正则

- 0.0.7
1. 更新"银行卡"的匹配长度为10-30位,参考[微信支付](https://pay.weixin.qq.com/wiki/doc/api/xiaowei.php?chapter=22_1)
- [x] 更新"银行卡"的匹配长度为10-30位,参考[微信支付](https://pay.weixin.qq.com/wiki/doc/api/xiaowei.php?chapter=22_1)

- 0.0.6
1. 修复"手机号(严禁)正则"错误.
- [x] 修复"手机号(严禁)正则"错误.

- 0.0.5
1. 增加正则"迅雷链接" / "ed2k连接" / "磁力链接" / "子网掩码" / "linux文件(夹)路径" / "window文件(夹)路径"
- [x] 增加正则"迅雷链接" / "ed2k连接" / "磁力链接" / "子网掩码" / "linux文件(夹)路径" / "window文件(夹)路径"


- 0.0.4
1. 优化"大于0, 小于150, 支持小数位出现5"减少没必要的捕获
2. 修复"html注释"没有匹配换行符
- [x] 优化"大于0, 小于150, 支持小数位出现5"减少没必要的捕获
- [x] 修复"html注释"没有匹配换行符

- 0.0.3

1. 解决vscode低版本兼容问题
2. 替换主页的git图地址
- [x] 解决vscode低版本兼容问题
- [x] 替换主页的git图地址
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 正则大全 ![](https://img.shields.io/badge/已收录-57条-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) ![](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)
# 正则大全 ![](https://img.shields.io/badge/已收录-58条-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) ![](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)

支持**图形界面** / **vscode插件**2种查询方式.

Expand All @@ -18,6 +18,11 @@ https://any86.github.io/any-rule/

## 正则

### 统一社会信用代码
```javascript
/[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}/
```

### 迅雷链接
```javascript
/^thunderx?:\/\/[a-zA-Z\d]+=$/
Expand Down
4 changes: 2 additions & 2 deletions __test__/rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ function testOne(one) {
}

if(0 === failGroup.length) {
console.log(chalk.green('\r\n全部测试通过!'))
console.log(chalk.green('\r\n🚀 全部测试通过!'))
} else {
console.log(chalk.red('='.repeat(30) + '未通过测试' + '='.repeat(30)));
console.log(chalk.red('='.repeat(30) + '🔥 未通过测试' + '='.repeat(30)));

// 失败列表
failGroup.forEach(item=>{
Expand Down
5 changes: 5 additions & 0 deletions packages/www/src/RULES.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
module.exports = [
{
title: '统一社会信用代码',
rule: /[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}/,
examples: ['91230184MA1BUFLT44', '92371000MA3MXH0E3W'],
},

{
title: '迅雷链接',
Expand Down

0 comments on commit d3dd1a2

Please sign in to comment.