mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 15:38:58 +08:00
perf: 数字/货币金额(支持负数、千分位分隔符)(#238)
This commit is contained in:
parent
c3d49bdba5
commit
977f357110
7
packages/www/src/RULES.js
vendored
7
packages/www/src/RULES.js
vendored
@ -139,14 +139,9 @@ module.exports = [{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '数字/货币金额(支持负数、千分位分隔符)',
|
title: '数字/货币金额(支持负数、千分位分隔符)',
|
||||||
rule: /^-?\d+(,\d{3})*(\.\d{1,2})?$/,
|
rule: /^-?\d{1,3}(,\d{3})*(\.\d{1,2})?$/ ,
|
||||||
examples: [100, -0.99, 3, 234.32, -1, 900, 235.09, '12,345,678.90']
|
examples: [100, -0.99, 3, 234.32, -1, 900, 235.09, '12,345,678.90']
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '数字/货币金额 (只支持正数、不支持校验千分位分隔符)',
|
|
||||||
rule: /(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/,
|
|
||||||
examples: [0.99, 8.99, 666]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '银行卡号(10到30位, 覆盖对公/私账户, 参考[微信支付](https://pay.weixin.qq.com/wiki/doc/api/xiaowei.php?chapter=22_1))',
|
title: '银行卡号(10到30位, 覆盖对公/私账户, 参考[微信支付](https://pay.weixin.qq.com/wiki/doc/api/xiaowei.php?chapter=22_1))',
|
||||||
rule: /^[1-9]\d{9,29}$/,
|
rule: /^[1-9]\d{9,29}$/,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user