Skip to content

Commit

Permalink
fix: updated email regex
Browse files Browse the repository at this point in the history
  • Loading branch information
YannicEl committed Dec 24, 2023
1 parent 7e23cdf commit 74e2201
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/lib/src/validators/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const regex = defineValidatorWithArgs(

// https://github.com/colinhacks/zod
const emailRegex =
/^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i;
/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;

export const email = defineValidator('email', (value) => regex(emailRegex).validate(value));

Expand Down

0 comments on commit 74e2201

Please sign in to comment.