[fix] 修复整数逻辑, ban "022", allow "22"

This commit is contained in:
Keeko 2022-03-11 16:30:39 +08:00
parent d71e412375
commit 043137e964
2 changed files with 8 additions and 13 deletions

View File

@ -2,11 +2,6 @@
🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台
## 🔥 我新开发的vscode插件
**any-type, 一键JSON转Typescript类型**
https://github.com/any86/any-type
## :rocket:web版本
https://any86.github.io/any-rule/
@ -49,7 +44,7 @@ vscode应用商店中搜索"**any-rule**".
**注意**: 图解直接使用了https://regexper.com, 在此对作者表示敬意和感谢.
</details>
## 🥠社区版本
## 社区版本
[idea版](https://github.com/zhoriya/idea-rule)
[Alfred Workflow版](https://github.com/cccyb/workflows)
@ -119,17 +114,17 @@ vscode应用商店中搜索"**any-rule**".
### linux"隐藏文件"路径
```javascript
/^\/(?:[^/]+\/)*\.[^/]*/
/^\/(?:[^\/]+\/)*\.[^\/]*/
```
### linux文件夹路径
```javascript
/^\/(?:[^/]+\/)*$/
/^\/(?:[^\/]+\/)*$/
```
### linux文件路径
```javascript
/^\/(?:[^/]+\/)*[^/]+$/
/^\/(?:[^\/]+\/)*[^\/]+$/
```
### window"文件夹"路径
@ -194,7 +189,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
```
### 数字/货币金额(支持负数、千分位分隔符)
@ -259,7 +254,7 @@ vscode应用商店中搜索"**any-rule**".
### 可以被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$/
/^\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(邮箱)
@ -439,7 +434,7 @@ vscode应用商店中搜索"**any-rule**".
### 整数
```javascript
/^-?[0-9]\d*$/
/^-?[1-9]\d*$/
```
### 浮点数

View File

@ -387,7 +387,7 @@ module.exports = [{
},
{
title: '整数',
rule: /^-?[0-9]\d*$/,
rule: /^-?[1-9]\d*$/,
examples: [-1231, 123]
},
{