in reply to regex to validate e-mail addresses and phone numbers
While the use of a proven module is a great idea, I do believe in re-inventing the wheel at times. This way you can gain a greater understanding of what's really going on. RFC 822 will give you a complete description of what is a valid email address. Keep in mind that all valid email addresses may not be deliverable and some invalid addresses can be deliverable. I guess the most important thing is to know what you are actually validating. The Perl Cookbook has some good information in chapters 6 and 18 regarding the validation of email addresses. Or, just use a module if you want a quick fix.
|