mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 07:38:58 +08:00
feat: Increase number-related regular verification
This commit is contained in:
parent
9c322ba759
commit
e0fcb8259b
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,5 +1,12 @@
|
||||
out
|
||||
node_modules
|
||||
coverage
|
||||
.nyc_output
|
||||
.vscode-test/
|
||||
.idea
|
||||
.vscode
|
||||
.DS_Store
|
||||
*.vsix
|
||||
yarn-error.log
|
||||
yarn-error.log
|
||||
.rpt2_cache
|
||||
dist
|
||||
|
30
packages/www/src/RULES.js
vendored
30
packages/www/src/RULES.js
vendored
@ -243,11 +243,6 @@ module.exports = [{
|
||||
rule: /^\d+\.\d+$/,
|
||||
examples: ['0.0', '0.09']
|
||||
},
|
||||
{
|
||||
title: '数字',
|
||||
rule: /^\d{1,}$/,
|
||||
examples: [12345678]
|
||||
},
|
||||
{
|
||||
title: 'html标签(宽松匹配)',
|
||||
rule: /<(\w+)[^>]*>(.*?<\/\1>)?/,
|
||||
@ -358,4 +353,29 @@ module.exports = [{
|
||||
rule: /^[a-zA-Z][0-9]{9}$/,
|
||||
examples: ['U193683453']
|
||||
},
|
||||
{
|
||||
title: '数字',
|
||||
rule: /^\d{1,}$/,
|
||||
examples: [12345678]
|
||||
},
|
||||
{
|
||||
title: '正整数,不包含0',
|
||||
rule: /^\+?[1-9]\d*$/,
|
||||
examples: [1231]
|
||||
},
|
||||
{
|
||||
title: '负整数,不包含0',
|
||||
rule: /^-[1-9]\d*$/,
|
||||
examples: [-1231]
|
||||
},
|
||||
{
|
||||
title: '整数',
|
||||
rule: /^-?[0-9]\d*$/,
|
||||
examples: [-1231, 123]
|
||||
},
|
||||
{
|
||||
title: '浮点数',
|
||||
rule: /^(-?\d+)(\.\d+)?$/,
|
||||
examples: [1.5]
|
||||
}
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user