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