in reply to Checking Email by reg expression
You could do it with a regular expression: see Jeffrey Friedl's book for the example. The trouble with this is that RFC 822 allows a rather large number of different formats - the example mentioned above is 6598 bytes long (Appendix B).
I'd suggest that using a regex is a very bad idea, and I would use something along the lines of Email::Valid to do it for me. If you don't want to use modules (why?), then follow the advice revealed by typing
at your command prompt. (Adjust for your OS and perl installation.)perldoc -q "How do I check a valid mail address?"
|
|---|