mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 15:38:58 +08:00
[feat] 更新浮点数逻辑
This commit is contained in:
parent
043137e964
commit
03471b0036
@ -439,7 +439,7 @@ vscode应用商店中搜索"**any-rule**".
|
|||||||
|
|
||||||
### 浮点数
|
### 浮点数
|
||||||
```javascript
|
```javascript
|
||||||
/^(-?\d+)(\.\d+)?$/
|
/^(-?[1-9]\d*\.\d+|-?0\.\d*[1-9]\d*|0\.0+)$/
|
||||||
```
|
```
|
||||||
|
|
||||||
### email(支持中文邮箱)
|
### email(支持中文邮箱)
|
||||||
|
@ -392,8 +392,9 @@ module.exports = [{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '浮点数',
|
title: '浮点数',
|
||||||
rule: /^(-?\d+)(\.\d+)?$/,
|
rule: /^(-?[1-9]\d*\.\d+|-?0\.\d*[1-9]\d*|0\.0+)$/,
|
||||||
examples: [1.5]
|
examples: ["1.23", "-1.01", "0.00"]
|
||||||
|
// allow "1.23", allow "-0.1", allow "0.00", ban "-0.00", allow "2.0", ban "2."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'email(支持中文邮箱)',
|
title: 'email(支持中文邮箱)',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user