Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/src/actions/email/email.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ describe('email', () => {
'あいうえお@example.com',
'email@あいうえお.com',
'email@example.あいう',
'Kſ@example.com',
]);
});

Expand Down
1 change: 1 addition & 0 deletions library/src/actions/rfcEmail/rfcEmail.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ describe('rfcEmail', () => {
'あいうえお@example.com',
'email@あいうえお.com',
'email@example.あいう',
'Kſ@example.com',
]);
});

Expand Down
3 changes: 2 additions & 1 deletion library/src/regex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export const DOMAIN_REGEX: RegExp =
* [Email address](https://en.wikipedia.org/wiki/Email_address) regex.
*/
export const EMAIL_REGEX: RegExp =
/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
// eslint-disable-next-line regexp/require-unicode-regexp, redos-detector/no-unsafe-regex -- false positive (recheck playground says this is safe). Intentionally omit /u because /iu makes \w match some non-ASCII chars via Unicode case-folding (e.g. K, ſ).
/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/i;

/**
* Emoji regex from [emoji-regex-xs](https://github.com/slevithan/emoji-regex-xs) v1.0.0 (MIT license).
Expand Down