All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Horst H. von Brand" <vonbrand@inf.utfsm.cl>
To: git@vger.kernel.org
Cc: Junio C Hamano <junkio@cox.net>,
	"Horst H. von Brand" <vonbrand@inf.utfsm.cl>
Subject: [PATCH] Cleanup git-send-email.perl:extract_valid_email
Date: Sat, 03 Jun 2006 13:11:48 -0400	[thread overview]
Message-ID: <11493547080-git-send-email-vonbrand@inf.utfsm.cl> (raw)

- 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

             reply	other threads:[~2006-06-03 18:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-03 17:11 Horst H. von Brand [this message]
2006-06-03 22:49 ` [PATCH] Cleanup git-send-email.perl:extract_valid_email 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11493547080-git-send-email-vonbrand@inf.utfsm.cl \
    --to=vonbrand@inf.utfsm.cl \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.