mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 15:38:58 +08:00
[fix] 修复整数逻辑, ban "022", allow "22"
This commit is contained in:
parent
d71e412375
commit
043137e964
19
README.md
19
README.md
@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台
|
🦕支持**web** / **vscode** / **idea** / **Alfred Workflow**多平台
|
||||||
|
|
||||||
## 🔥 我新开发的vscode插件
|
|
||||||
**any-type, 一键JSON转Typescript类型**
|
|
||||||
|
|
||||||
https://github.com/any86/any-type
|
|
||||||
|
|
||||||
## :rocket:web版本
|
## :rocket:web版本
|
||||||
https://any86.github.io/any-rule/
|
https://any86.github.io/any-rule/
|
||||||
|
|
||||||
@ -49,7 +44,7 @@ vscode应用商店中搜索"**any-rule**".
|
|||||||
**注意**: 图解直接使用了https://regexper.com, 在此对作者表示敬意和感谢.
|
**注意**: 图解直接使用了https://regexper.com, 在此对作者表示敬意和感谢.
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## 🥠社区版本
|
## 社区版本
|
||||||
[idea版](https://github.com/zhoriya/idea-rule)
|
[idea版](https://github.com/zhoriya/idea-rule)
|
||||||
|
|
||||||
[Alfred Workflow版](https://github.com/cccyb/workflows)
|
[Alfred Workflow版](https://github.com/cccyb/workflows)
|
||||||
@ -119,17 +114,17 @@ vscode应用商店中搜索"**any-rule**".
|
|||||||
|
|
||||||
### linux"隐藏文件"路径
|
### linux"隐藏文件"路径
|
||||||
```javascript
|
```javascript
|
||||||
/^\/(?:[^/]+\/)*\.[^/]*/
|
/^\/(?:[^\/]+\/)*\.[^\/]*/
|
||||||
```
|
```
|
||||||
|
|
||||||
### linux文件夹路径
|
### linux文件夹路径
|
||||||
```javascript
|
```javascript
|
||||||
/^\/(?:[^/]+\/)*$/
|
/^\/(?:[^\/]+\/)*$/
|
||||||
```
|
```
|
||||||
|
|
||||||
### linux文件路径
|
### linux文件路径
|
||||||
```javascript
|
```javascript
|
||||||
/^\/(?:[^/]+\/)*[^/]+$/
|
/^\/(?:[^\/]+\/)*[^\/]+$/
|
||||||
```
|
```
|
||||||
|
|
||||||
### window"文件夹"路径
|
### window"文件夹"路径
|
||||||
@ -194,7 +189,7 @@ vscode应用商店中搜索"**any-rule**".
|
|||||||
|
|
||||||
### base64格式
|
### base64格式
|
||||||
```javascript
|
```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
|
### 可以被moment转化成功的时间 YYYYMMDD HH:mm:ss
|
||||||
```javascript
|
```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(邮箱)
|
### email(邮箱)
|
||||||
@ -439,7 +434,7 @@ vscode应用商店中搜索"**any-rule**".
|
|||||||
|
|
||||||
### 整数
|
### 整数
|
||||||
```javascript
|
```javascript
|
||||||
/^-?[0-9]\d*$/
|
/^-?[1-9]\d*$/
|
||||||
```
|
```
|
||||||
|
|
||||||
### 浮点数
|
### 浮点数
|
||||||
|
@ -387,7 +387,7 @@ module.exports = [{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '整数',
|
title: '整数',
|
||||||
rule: /^-?[0-9]\d*$/,
|
rule: /^-?[1-9]\d*$/,
|
||||||
examples: [-1231, 123]
|
examples: [-1231, 123]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user