diff --git a/src/app/components/utils/user-password-input.vue b/src/app/components/utils/user-password-input.vue index 05d083e11..c941c5514 100644 --- a/src/app/components/utils/user-password-input.vue +++ b/src/app/components/utils/user-password-input.vue @@ -37,7 +37,8 @@ const isNew = computed(() => { const v$ = useVuelidate( computed(() => { - const vRegexRule = (v) => (vRegex.value ? vRegex.value.test(v) : false); + const regexpInstance = new RegExp(vRegex.value); + const vRegexRule = (v) => (vRegex.value ? regexpInstance.test(v) : false); const regex = helpers.withParams( { regex: vRegex.value }, @@ -78,7 +79,7 @@ const loadV = async () => { ({ name }) => name === EngineSystemSettingName.PasswordValidationText, )?.value; - vRegex.value = new RegExp(regex); + vRegex.value = regex; vErrorText.value = errorText; };