Monorepo for Tangled tangled.org

appview/email: Replace regex check with mail.ParseAddress. Add unit tests. #839

merged opened by evan.jarrett.net targeting master from evan.jarrett.net/core: email-verify

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.

Labels
enhancement
refactor
assignee

None yet.

Participants 3
AT URI
at://did:plc:pddp4xt5lgnv2qsegbzzs4xg/sh.tangled.repo.pull/3m6wsdc42ic22
Interdiff #0 โ†’ #1
appview/email/email.go

This file has not been changed.

appview/email/email_test.go

This file has not been changed.

History

2 rounds 2 comments
sign up or login to add to the discussion
1 commit
expand
appview/email: replace regex check with mail.ParseAddress
expand 1 comment

lgtm thanks!

pull request successfully merged
1 commit
expand
appview/email: Replace regex check with mail.ParseAddress. Add unit tests.
expand 1 comment

Good one! Can you re-author to fit the guidelines? Can just be "appview/email: replace regex check with mail.ParseAddress".