|
@@ -33,5 +33,15 @@ export class ValidatorHelper {
|
|
let regexp: RegExp = new RegExp('(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)');
|
|
let regexp: RegExp = new RegExp('(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)');
|
|
return regexp.test(idcardNum)
|
|
return regexp.test(idcardNum)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 是否为密码
|
|
|
|
+ * @param password
|
|
|
|
+ * @returns
|
|
|
|
+ */
|
|
|
|
+ public static isPassword(password: string) {
|
|
|
|
+ let regexp: RegExp = new RegExp('(^(?=.*[a-zA-Z])(?=.*\\d)[A-Za-z\\d!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~]{8,12}$)');
|
|
|
|
+ return regexp.test(password)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|