News for hackers. Stuff that matters.
Re:Stop Validating Email Addresses with Regex (2012) by sverhagen on Wednesday April 20, 2022 @01:49AM (#31093323)
Agreed. And while I wouldn't attempt creating a regex for email addresses -- if I really felt I needed that, I think that's what libraries are for, not my job -- I have used plenty of regexes in useful and successful ways. I wanted to really add to your "you won't need to edit it for 20 years" comment that the regex should also be anchored with a unit test, that demonstrates the usages you designed for (and maybe a few negative tests to show what you specifically didn't intend to solve).

There are no comments on this comment yet.