Last 12 weeks · 0 commits
4 of 6 standards met
The perfect email regex It turns out that the parts of rfc 5322 responsible for defining what an email is, can be cross-compiled 1:1 to regex. At some point I will publish this abnf to regex converter (update: published at https://github.com/Richienb/abnf-regex). (I am also waiting for this PR which would improve the optimisation phase https://github.com/DmitrySoshnikov/regexp-tree/pull/269) TODO: [x] Seperate out repetitive parts [x] Add option to allow ? https://github.com/sindresorhus/email-regex/issues/15 [x] Add option to allow domain part with only 1 part? https://github.com/sindresorhus/email-regex/issues/2#issuecomment-506979632 Fixes #9, fixes #2, fixes #15
Repository: sindresorhus/email-regex. Description: Regular expression for matching email addresses Stars: 149, Forks: 17. Primary language: JavaScript. Languages: JavaScript (96.1%), TypeScript (3.9%). License: MIT. Latest release: v6.1.0 (6mo ago). Open PRs: 0, open issues: 0. Last activity: 6mo ago. Community health: 71%. Top contributors: sindresorhus, Richienb, fibo, jamiekyle-eb, kevva, moetezch, SamVerschueren, evagy.
Regex size is approximately halved Notable changes: / and / are merged because they match the same thing Don't match folding white space (FWS) because it is not used in the actual email, but rather to format the email if it is too long for a single line of an email message. This technically removes the use case of extracting emails from a large dataset of text data that might contain email messages, if those emails span multiple lines