Skip to content

Commit ffd48c3

Browse files
abhix4abhi
and
abhi
authored
fix: improve email validation regex (#1251)
Co-authored-by: abhi <[email protected]>
1 parent 1042fc4 commit ffd48c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/mail/components/create/email-composer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ interface EmailComposerProps {
7373
}
7474

7575
const isValidEmail = (email: string): boolean => {
76-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
76+
const emailRegex = /^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
7777
return emailRegex.test(email);
7878
};
7979

0 commit comments

Comments
 (0)