Created
May 10, 2024 20:51
-
-
Save dfkaye/41ece9a08a6b447c8d933ad0e573557c to your computer and use it in GitHub Desktop.
email valid regex quick and dirty from Kyle Simpson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 10 May 2024 | |
// Not mine! The regexp is from a tweet by Kyle Simpson | |
// https://twitter.com/getifyX/status/1788895673821118886 | |
var reEmailAddress = /^[^@]+@[^@.]+(?:\.[^@.]+)+$/; | |
["a@b.c", { toString: () => "a@b.c" }, ["a@b.c"]].map(email => reEmailAddress.test(email)); | |
// Array(3) [ true, true, true ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment