I just watched a video where someone demo’d GitHub Copilot by writing a comment along the lines of
// IsValidEmail takes a string and returns whether it’s a valid email address
The AI response was a nightmarish 100+ character regex that made my blood curdle.I think of email validation like encryption: don’t roll your own, and don’t trust an AI to do it either.
Edit: Here's the regex: https://gist.github.com/cassidoo/6101ef0657665683b787aab5ae9...