|We don't bite newbies here... much|
Re: Please evaluate: RegEx for validating e-mail addressesby DaWolf (Curate)
|on Sep 25, 2004 at 20:23 UTC||Need Help??|
Please guys, let me make some statements here, since I was apparently misunderstood:
I've understood Ovid's post, davido and really appreciated his contribution (as usual), but I'd like to *learn* to build a regex for that matter.
Just because a "standard" way of building it exists it's not unmutable, e.g.:
Ovid first allows a whitespace and/or tab to be in the beginning of the e-mail address:
I wouldn't do that. *My* line of thinking and the logic that reigns on the app I'm coding is: if the user has entered a whitespace in the beginning of the webform field, well, too bad for him. Even better, I'd write a JS function to disable whitespaces on that field. Since it's a web app it's better for me (and most probably for the user) to do it this way.
The *only thing* I want to do is to validate an e-mail address (not something like "My name <email@example.com>") using a regex built by *me*. I want to learn that. I don't care if there is a module that already has this implemented. I don't care if there is a "generally accepted" way of doing it. I want to do it myself because I want to understand the full concept of it and then learn from it.
All I've wanted was some advices and tips on how to do it and some critcics on my regex.
So far in this node, only Ovid provided me that (with the link to the RFC and the addresses examples fom Mastering Regular Expressions).