税号校验、数字校验
This commit is contained in:
@@ -53,3 +53,19 @@ export function chineseReg(s) {
|
||||
export function postcode(s) {
|
||||
return /^[0-9]\d{5}$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 税号
|
||||
* message:15位、17位、18位、20位数字和大写英文字母
|
||||
* */
|
||||
export function taxNo(s) {
|
||||
return /^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
* 只能输入数字
|
||||
* @param s
|
||||
*/
|
||||
export function number(s) {
|
||||
return /^[0-9]*$/.test(s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user