From: Pierre Habouzit Date: Sat, 01 Nov 2008 17:43:52 GMT Subject: Re: [PATCH 2/3] git send-email: do not ask questions when --compose is used. 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: > Le Saturday 01 November 2008 18:08:17 Pierre Habouzit, vous avez écrit : > [...] > > > > To: John Doe , Random Joe , > > Superman , > > "Someone with a comma, inside its tag name" > > > > fg@erwin ~ $ cat t.txt > To: John Doe , Random Joe , > Superman , "Someone with a comma, inside its tag name" > > fg@erwin ~ $ \s*<[^@]+@[^@]+>)\s*,?/g; END { print join("\n", @mails) . "\n"}' > > > > "Someone with a comma, inside its tag name" > > That's regex, not especially perl ;) Your regex fails to parse: "Someone with a comma, and an escape double quote \" in its name" 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