Re: [PATCH 2/3] git send-email: do not ask questions when --compose is used.
- From
Pierre Habouzit <madcoder@debian.org>
- Date
- Nov 1, 2008, 17:43 UTC
- Message-ID
- <20081101174352.GG26229@artemis.corp>
- In-Reply-To
- <200811011834.32702.fg@one2team.com>
On Sat, Nov 01, 2008 at 05:34:32PM +0000, Francis Galiegue wrote:
Show 20 quoted lines
> Le Saturday 01 November 2008 18:08:17 Pierre Habouzit, vous avez écrit :
> [...]
> >
> > To: John Doe <some.address@some.tld>, Random Joe <random.joe@abc.def>,
> > Superman <batman@nyc.us>,
> > "Someone with a comma, inside its tag name" <a@b.com>
> >
>
> fg@erwin ~ $ cat t.txt
> To: John Doe <some.address@some.tld>, Random Joe <random.joe@abc.def>,
> Superman <batman@nyc.us>, "Someone with a comma, inside its tag name"
> <a@b.com>
> fg@erwin ~ $ <t.txt perl -ne 's,^To:\s*,,i; @mails = m/\s*((?:"[^"]+")?
> \s*<[^@]+@[^@]+>)\s*,?/g; END { print join("\n", @mails) . "\n"}'
> <some.address@some.tld>
> <random.joe@abc.def>
> <batman@nyc.us>
> "Someone with a comma, inside its tag name" <a@b.com>
>
> That's regex, not especially perl ;)Your regex fails to parse:
"Someone with a comma, and an escape double quote \" in its name" <regex.cant.be.used.for.serious.parsing@i.told.you.so>
That's why I first hinted at some MIME library that has probably made that right.
Not to mention that you don't fix the multiline issue, but that is quite less of a problem, it merely needs an accumulator and a 1 line lookahead in the parser code while in the header parts. Nothing unrealistic for me to write.
But I just can't resolve myself to parse anything with regex because I just know it's horribly broken and wrong.
-- ·O· Pierre Habouzit ··O madcoder@debian.org OOO http://www.madism.org