in reply to input - E-mail address - how to check string ?

Hi Zalezny

I suggest to search a bit in CPAN - there is surely a module for it that fits your need. Possibly Email::Valid.

HTH, Rata

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

Replies are listed 'Best First'.
Re^2: input - E-mail address - how to check string ?
by zalezny (Novice) on Feb 25, 2015 at 09:24 UTC
    Hi, I`m not allowed to use it on my server. I`m searching for regular expression. My server is old crap and I`m not allowed to install on it anything new. Its RHEL 3.9, not supported without repos... Thats why I`m searching for regexp.

      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.