in reply to Re^2: input - E-mail address - how to check string ?
in thread input - E-mail address - how to check string ?

I'm sorry if this sounds like I'm annoyed with you; I'm not, but this is a pet peeve of mine. Really. I'm trying very hard not to rant.

Whatever you do, make sure that it supports (at least) all valid email addresses, which your regex doesn't. Read the RFCs. Many people assume that the left side of the "@" is as restricted as the right side. It isn't so. Among the many discussions, please see http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address?rq=1

It really annoys me to run into some web-site which won't let me enter a perfectly valid email address because someone has done as you're trying to do and botched it, as you're probably going to do. No offence intended; an email address is a non-trivial thing to parse.

By saying in effect "I'm not allowed to use CPAN", you're depriving yourself of one of the major reasons to use perl, and inviting errors in implementation. If you're not allowed to install CPAN modules system-wide, there are lots of ways to install them for a project, ending with copy/paste the code from CPAN.

  • Comment on Re^3: input - E-mail address - how to check string ?