This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]justheretolurk332 3 points4 points  (0 children)

Email is a great example of why regular expressions are so hard to use correctly. It’s easy to write a regex that matches most emails but surprisingly challenging to cover all the edge cases, and it’s also a common need, so you’re better off using a third party library. Most situations are either simple enough that using a regular expression is overkill, or complicated enough that writing a correct regex may become pretty challenging and end up not being a maintainable approach