View Single Post
Old 04-25-2011, 09:27 PM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
This is an email regex i did years ago:

Code:
&ReadParse(*input);
$user_email = $input{'01)required-user_email'};

if ($user_email =~ /(\w{1}[\w-.]*)\@([\w-.]+)/) {
    $user_email = "$1\@$2";
    if( $2 =~ /(domain\.com|domain\.com)/i){
	    &disallowed_domain;
	    exit;
}    
} else {
    warn ("TAINTED DATA SENT BY $ENV{'REMOTE_ADDR'}: $user_email: $!");
    $user_email = ""; # successful match did not occur
    &illegal;
    exit;
}
 

if ($user_email =~m:^(.*)\@\@(.*)\.(.*)$:) {
&BadFormat;
exit;
}
if ($user_email =~m:^(www\.):) {
&BadFormat2;
exit;
}

if ($user_email =~m:^(.*)\@(.*)\.(.*)$:) { ...}
More understandable ...
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote