git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Cleanup git-send-email.perl:extract_valid_email
@ 2006-06-03 17:11 Horst H. von Brand
  2006-06-03 22:49 ` Eric Wong
  0 siblings, 1 reply; 11+ messages in thread
From: Horst H. von Brand @ 2006-06-03 17:11 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Horst H. von Brand

- 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 <vonbrand@inf.utfsm.cl>
---
 git-send-email.perl |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index ed1d89b..a7a7797 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;
 	}
 }
 
-- 
1.3.3.g86f7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-06-06 22:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-03 17:11 [PATCH] Cleanup git-send-email.perl:extract_valid_email Horst H. von Brand
2006-06-03 22:49 ` Eric Wong
2006-06-04  0:10   ` Horst von Brand
2006-06-06  6:59     ` Junio C Hamano
2006-06-06 15:42       ` Horst von Brand
2006-06-06 15:54         ` Junio C Hamano
2006-06-06 16:05           ` Horst von Brand
2006-06-06 16:58             ` Junio C Hamano
2006-06-06 21:24               ` Horst von Brand
2006-06-06 21:39                 ` Junio C Hamano
2006-06-06 22:48                   ` Horst von Brand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).