http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
Adding that kind of thing to a project requires a calm cost-benefit analysis and very likely can not be done without the input of everybody working on the project.
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
Adding that kind of thing to a project requires a calm cost-benefit analysis and very likely can not be done without the input of everybody working on the project.
a) read the 47 page standard and implement every single requirement, one if statement at a time, and end up writing 10s of thousands of lines of code that are nearly unverifiable.
b) copy that one regex from the standard, put it in a nice function with a comment on where to find the standard, and move on with your life.
Option b will not only save you a week, but also make it much less likely that you screwed up.
You're skipping entirely over option C:
c) Send the user an email asking them to validate their email.
You'll notice option C is actually the preferred method of almost every company that needs your email to be valid. Option C also does not use a regex at all.
But that's a diversion. You can import a library that will do the same just as well as you can import that regex. Both will have comparable levels of gains and problems, but of very different nature.