|
From: | Peter Boughton |
Subject: | Re: PCRE |
Date: | Fri, 2 Jun 2023 17:37:17 +0100 |
Anyhow... On 02/06/2023 14:59, Sebastian Carlos wrote:
I want to point out something that may have been missed at first: Grep's PCRE support (grep -P) does not include the multi-line processing features, Therefore I think that shouldn't be an impediment to implement PCRE support in sed. According to Grep manual, 2.4 "grep Programs":By default, grep applies each regexp to a line at a time, so the [PCRE]‘(?s)’ directive (making ‘.’ match line breaks) is generally ineffective.
Checking both "man grep" on Debian and the PDF manual I have to hand (GNU Grep v3.4), neither of them contain that text. Nor does a quick search of the grep source for "generally ineffective" return any results.
One can easily demonstrate that it *is* effective: $ echo -e 'abc\na\nc' | grep -zoP 'a.c' abc $ echo -e 'abc\na\nc' | grep -zoP '(?s)a.c' abca cHowever, even if it didn't work, it wouldn't really be relevant - with or without newline-related features there is no need for PCRE in Sed when one can just use Perl.
[Prev in Thread] | Current Thread | [Next in Thread] |