Re: [PATCH] grep -P: Fix matching ^ and $
On 02/25/2012 10:30 AM, Michał Kiedrowicz wrote:
Show 8 quoted lines
> Michał Kiedrowicz<michal.kiedrowicz@gmail.com> 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