Skip to content

Commit

Permalink
[ui] Validate that email addresses have TLD (#14870)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 3d8e23dde8cb6bd432b5421923562459699354f1
  • Loading branch information
coreymartin authored and Lightspark Eng committed Jan 14, 2025
1 parent 4554fd3 commit 1c40c02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui/src/hooks/useFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const defaultMsgs = {
const regexp = {
phone: /^[2-9]{1}[0-9]{9}$/,
postalCode: /(^\d{5}$)|(^\d{5}-\d{4}$)/,
email: /^.+@.+$/,
email: /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,
state:
/^(A[LKSZRAEP]|C[AOT]|D[EC]|F[LM]|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[ARW]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$/,
};
Expand Down

0 comments on commit 1c40c02

Please sign in to comment.