locked_user Thailand_for_YOU has asked for the wisdom of the Perl Monks concerning the following question:
I've found a script called email_check (enclosed below) that partly do the job.
Maybe someone can help me.
If someone needs the origial script (wel.cgi), I can send it by email or post here.########################################### sub email_check { local($email) = $_[0]; # Check that the email address doesn't have 2 @ signs, a .., a @., a # .@ or begin or end with a . if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)/ || # Allow anything before the @, but only letters numbers, dashes # and periods after it. Also check to make sure the address ends # in 2 or 3 letters after a period and allow for it to be enclosed # in [] such as [164.104.50.1] ($email !~ /^.+\@localhost$/ && $email !~ /^.+\@\[?(\w|[-.])+\.[a-zA-Z]{2,3}|[0-9]{1,3}\]?$/)) { return(0); } # If it passed the above test, it is valid. else { return(1); } } 1; ###########################################
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding Email Validity Test to the existing script.
by Angel (Friar) on Jun 30, 2003 at 11:42 UTC | |
|
Re: Adding Email Validity Test to the existing script.
by BazB (Priest) on Jun 30, 2003 at 11:46 UTC | |
|
Re: Adding Email Validity Test to the existing script.
by Abigail-II (Bishop) on Jun 30, 2003 at 11:57 UTC | |
by tbone1 (Monsignor) on Jun 30, 2003 at 12:54 UTC | |
by Abigail-II (Bishop) on Jun 30, 2003 at 13:51 UTC | |
|
Re: Adding Email Validity Test to the existing script.
by adrianh (Chancellor) on Jul 01, 2003 at 21:21 UTC |