> Junio C Hamano <[email protected]> writes
> Suffix "rgx" that means "regular expression" is a bit unusual, and
> also hard to read when squashed to another word.  Elsewhere in the
> same script, we seem to use $re_whatever to store precompiled
> regular expressions, so perhaps $re_comment, $re_quote, etc.?

Yes it's indeed a better name. I had not seen it, thanks!


> > +                if ($str_address ne "" && $str_phrase ne "") {
> > +                    $str_address = qq[<$str_address>];
> > +                }
> 
> We see both "[email protected]" and "<[email protected]>" around
> here for an address without comment or phrase; this chooses to turn
> them both into "<[email protected]>" form?  Not a complaint but am
> thinking aloud to see if I am reading it correctly.

If there's no phrase, this will choose the "[email protected]" form,
in both cases, because it'll be recognize as an address, $str_address
will be "[email protected]" and $str_phrase will be empty before the
if ($str_address ne "" ...)
Here are some tests:

Input: <[email protected]>
Split: [email protected]
M::A : [email protected]
----------
Input: [email protected]
Split: [email protected]
M::A : [email protected]
----------
Input: Jane <[email protected]>
Split: Jane <[email protected]>
M::A : Jane <[email protected]>
----------
Input: Jane Doe <[email protected]>
Split: Jane Doe <[email protected]>
M::A : Jane Doe <[email protected]>
----------
Input: "Jane" <[email protected]>
Split: "Jane" <[email protected]>
M::A : "Jane" <[email protected]>
----------
Input: "Doe, Jane" <[email protected]>
Split: "Doe, Jane" <[email protected]>
M::A : "Doe, Jane" <[email protected]>

I've some more tests, maybe I should put them all in this post ?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to