From: Zbigniew Jędrzejewski-Szmek Date: Sat, 25 Feb 2012 17:52:56 GMT Subject: Re: [PATCH] grep -P: Fix matching ^ and $ Message-ID: <4F491FF8.9070609@in.waw.pl> In-Reply-To: <20120225103050.14f52a91@gmail.com> On 02/25/2012 10:30 AM, Michał Kiedrowicz wrote: > Michał Kiedrowicz wrote: > >> When `git-grep` is run with -P/--perl-regexp, it doesn't match ^ and $ at >> the beginning/end of the line. This is because PCRE normally matches ^ >> and $ at the beginning/end of the whole text, not for each line, and git-grep >> firstly passes a large chunk of text (possibly containing many lines) to >> pcre_exec() before it splits the text into lines. This makes `git-grep -P` >> behave differently from `git-grep -E` and also from `grep -P` and `pcregrep`: Thanks! I can confirm that I now get the expected output. Zbyszek > Original report: > http://permalink.gmane.org/gmane.comp.version-control.git/190830