Code

send-email: extract_valid_address use qr// regexes
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 30 Sep 2010 19:03:31 +0000 (19:03 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Sep 2010 20:06:47 +0000 (13:06 -0700)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl

index 1890409232ce2407ed4cba16f1c65e87d1df19e9..db17aae0207ed501a479e21e36f6d6ab6aa67adb 100755 (executable)
@@ -777,8 +777,8 @@ our ($message_id, %mail, $subject, $reply_to, $references, $message,
 
 sub extract_valid_address {
        my $address = shift;
-       my $local_part_regexp = '[^<>"\s@]+';
-       my $domain_regexp = '[^.<>"\s@]+(?:\.[^.<>"\s@]+)+';
+       my $local_part_regexp = qr/[^<>"\s@]+/;
+       my $domain_regexp = qr/[^.<>"\s@]+(?:\.[^.<>"\s@]+)+/;
 
        # check for a local address:
        return $address if ($address =~ /^($local_part_regexp)$/);