fix: name regex (#4328)

This commit is contained in:
Dhruwang Jariwala
2024-11-18 17:28:27 +05:30
committed by GitHub
parent 43b1cb904d
commit 7f8549124f

View File

@@ -26,7 +26,7 @@ export const ZUserName = z
.string()
.trim()
.min(1, { message: "Name should be at least 1 character long" })
.regex(/^[a-zA-Z0-9\s]+$/, { message: "Name should only contain letters, numbers, and spaces" });
.regex(/^[\p{L}\p{M}\s'\d-]+$/u, "Invalid name format");
export type TUserNotificationSettings = z.infer<typeof ZUserNotificationSettings>;