税号校验、数字校验

This commit is contained in:
zhaoxiao
2021-08-27 10:46:52 +08:00
parent b68a8c57b3
commit 40383e6a5e
+16
View File
@@ -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)
}