git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
To: git@vger.kernel.org
Cc: "Michał Kiedrowicz" <michal.kiedrowicz@gmail.com>
Subject: Re: [PATCH] grep -P: Fix matching ^ and $
Date: Sat, 25 Feb 2012 18:52:56 +0100	[thread overview]
Message-ID: <4F491FF8.9070609@in.waw.pl> (raw)
In-Reply-To: <20120225103050.14f52a91@gmail.com>

On 02/25/2012 10:30 AM, Michał Kiedrowicz wrote:
> 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

  reply	other threads:[~2012-02-25 17:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-25  9:24 [PATCH] grep -P: Fix matching ^ and $ Michał Kiedrowicz
2012-02-25  9:30 ` Michał Kiedrowicz
2012-02-25 17:52   ` Zbigniew Jędrzejewski-Szmek [this message]
2012-02-26 22:39 ` Junio C Hamano
2012-02-27 16:45   ` [PATCH] grep -P: add tests for " Zbigniew Jędrzejewski-Szmek
2012-02-27 20:21     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F491FF8.9070609@in.waw.pl \
    --to=zbyszek@in.waw.pl \
    --cc=git@vger.kernel.org \
    --cc=michal.kiedrowicz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).