From: Horst H. von Brand Date: Sat, 3 Jun 2006 17:11:48 +0000 (-0400) Subject: Cleanup git-send-email.perl:extract_valid_email X-Git-Tag: v1.4.0-rc2~17^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e96fd30553bb57a76ad38f703a3fea5b53c45ff9;p=git.git Cleanup git-send-email.perl:extract_valid_email - Fix the regular expressions for local addresses - Fix the fallback regexp for non-local addresses, simplify the logic Signed-off-by: Horst H. von Brand Signed-off-by: Junio C Hamano --- diff --git a/git-send-email.perl b/git-send-email.perl index ed1d89b3..a7a77977 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -314,18 +314,15 @@ sub extract_valid_address { my $address = shift; # check for a local address: - return $address if ($address =~ /^([\w\-]+)$/); + return $address if ($address =~ /^([\w\-.]+)$/); if ($have_email_valid) { return Email::Valid->address($address); } else { # less robust/correct than the monster regexp in Email::Valid, # but still does a 99% job, and one less dependency - my $cleaned_address; - if ($address =~ /([^\"<>\s]+@[^<>\s]+)/) { - $cleaned_address = $1; - } - return $cleaned_address; + $address =~ /([\w\-.]+@[\w\-.]+)/; + return $1; } }