O.K. working for a understanding of the best regular expression to confirm a valid PATTERN of a possible email address. (so I code to keep my members from making simple mistakes in typoís on there email addresses, simply)

Hereís my routine (with debugging comments)

Code:
sub validateemail {
        my ($email_address) = @_; #note bono for some reason parentheses required!! addmember.pl
        print "the email address is $email_address.<P>\n";
        if ($email_address =~ *****REGULAR EXPRESSION HERE*****) {
                print "$email_address is valid";
                return 1;
        } else {
                print "$email_address is invalid";
                return 0;
        }
} # close of validateemail
My guess is any number of letters and numbers and a few characters such as periods. Then an ď@Ē then a any number of numbers and letters, at least one period and a few letters.


I havenít my regular expression book, but Iím some recollection of doing the above before, so started searched for existing code rather than writing one outÖ hereís some examples from web, havenít had them work as of yet:

Code:
      if ($email_address =~ /^(\w¬¶\-¬¶\_¬)+\@((@((\w¬¶\)+\.)+[a-zA-Z]{2,}$/) { /) {
Code:
if ($email =~ m/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/) {
NEXT ONE IS GENERATED, takes a FULL PAGE easier to show the url:

Mail::RFC822::Address

so anyone have a favorite snippet that would allow something like 1extravagant.name@this.really.is.2a.domain.biz ??