Was troubleshooting an issue in discord and wrote some tests to verify things were parsed correctly. The orignal regex was missing leading and trailing period detection. Go has a built in function for parsing/validating email addresses based on the RFC that doesn't use regex, and performs slightly faster in a benchmark.
Monorepo for Tangled โ https://tangled.org
appview/email: Replace regex check with mail.ParseAddress. Add unit tests. #839
merged
opened by
expand 1 commit
hide 1 commit
appview/email: Replace regex check with mail.ParseAddress. Add unit tests.
Signed-off-by: Evan Jarrett <evan@evanjarrett.com>
expand 1 commit
hide 1 commit
appview/email: replace regex check with mail.ParseAddress
Signed-off-by: Evan Jarrett <evan@evanjarrett.com>
Good one! Can you re-author to fit the guidelines? Can just be "appview/email: replace regex check with mail.ParseAddress".