mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 15:38:58 +08:00
fix: 整数包含0(#263)
This commit is contained in:
parent
f36ebbde10
commit
a9100ebe20
@ -461,7 +461,7 @@ vscode应用商店中搜索"**any-rule**".
|
||||
|
||||
### 整数
|
||||
```javascript
|
||||
/^-?[1-9]\d*$/
|
||||
/^(?:0|(?:-?[1-9]\d*))$/
|
||||
```
|
||||
|
||||
### 浮点数
|
||||
|
5
packages/www/src/RULES.js
vendored
5
packages/www/src/RULES.js
vendored
@ -414,8 +414,9 @@ module.exports = [{
|
||||
},
|
||||
{
|
||||
title: '整数',
|
||||
rule: /^-?[1-9]\d*$/,
|
||||
examples: [-1231, 123]
|
||||
rule: /^(?:0|(?:-?[1-9]\d*))$/,
|
||||
examples: [-1231, 123, 0],
|
||||
counterExamples: ['01']
|
||||
},
|
||||
{
|
||||
title: '浮点数',
|
||||
|
Loading…
x
Reference in New Issue
Block a user