Add Unicode flag for field pattern validator (#290)

This commit is contained in:
Ildar Galeev 2024-03-21 14:25:08 +07:00 committed by GitHub
parent e853f8a084
commit 435a0190b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,7 +64,7 @@ const createValidator =
return validatePhone(value);
}
if (pattern) {
return !new RegExp(pattern).test(value);
return !new RegExp(pattern, 'u').test(value);
}
if (required) {
return !value || !value.trim();