From 095d1d30241f4ae14f8ede76e69489309d1e3d23 Mon Sep 17 00:00:00 2001 From: Weipeng Qi Date: Tue, 19 Nov 2024 16:31:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B3=A8=E5=86=8C=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ets/utils/ValidatorHelper.ets | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/ets/utils/ValidatorHelper.ets b/src/main/ets/utils/ValidatorHelper.ets index 71df45e..dbac81a 100644 --- a/src/main/ets/utils/ValidatorHelper.ets +++ b/src/main/ets/utils/ValidatorHelper.ets @@ -33,5 +33,15 @@ export class ValidatorHelper { let regexp: RegExp = new RegExp('(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)'); 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) + } }