mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 15:38:58 +08:00
Merge branch 'master' of https://github.com/any86/any-rule
# Conflicts: # README.md # src/RULES.js
This commit is contained in:
commit
a9d87ebddb
10
README.md
10
README.md
@ -6,6 +6,16 @@
|
||||
/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*?)\s*$/i
|
||||
```
|
||||
|
||||
## 数字/货币金额(支持负数、千分位分隔符)
|
||||
```javascript
|
||||
/(^[-]?[1-9]\d{0,2}($|(,\d{3})*($|(\.\d{1,2}$))))|((^[0](\.\d{1,2})?)|(^[-][0]\.\d{1,2}))$/
|
||||
```
|
||||
|
||||
## 数字/货币金额 (只支持正数、不支持校验千分位分隔符)
|
||||
```javascript
|
||||
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
||||
```
|
||||
|
||||
## 银行卡号(16或19位)
|
||||
```javascript
|
||||
/^([1-9]{1})(\d{15}|\d{18})$/
|
||||
|
10
src/RULES.js
10
src/RULES.js
@ -3,6 +3,16 @@ module.exports = [{
|
||||
rule: /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i,
|
||||
example: 'data:image/gif;base64,xxxx=='
|
||||
},
|
||||
{
|
||||
title: '数字/货币金额(支持负数、千分位分隔符)',
|
||||
rule: /(^[-]?[1-9]\d{0,2}($|(,\d{3})*($|(\.\d{1,2}$))))|((^[0](\.\d{1,2})?)|(^[-][0]\.\d{1,2}))$/,
|
||||
example: '如: 100、-0.99、3,234.32、-1,900,235.09'
|
||||
},
|
||||
{
|
||||
title: '数字/货币金额 (只支持正数、不支持校验千分位分隔符)',
|
||||
rule: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
|
||||
example: '如: 0.99、8.99、666'
|
||||
},
|
||||
{
|
||||
title: '银行卡号(16或19位)',
|
||||
rule: /^([1-9]{1})(\d{15}|\d{18})$/,
|
||||
|
Loading…
x
Reference in New Issue
Block a user