GNU bug report logs - #51458
grep PCRE - mean

Previous Next

Package: grep;

Reported by: "Skrzyniarz, Slawomir (Nokia - PL/Krakow)" <slawomir.skrzyniarz <at> nokia.com>

Date: Thu, 28 Oct 2021 09:11:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 51458 <at> debbugs.gnu.org (full text, mbox):

From: Carlo Marcelo Arenas Belón <carenas <at> gmail.com>
To: slawomir.skrzyniarz <at> nokia.com
Cc: 51458 <at> debbugs.gnu.org
Subject: bug#51458: grep PCRE - '^' and '$' are not recognized as begin and
 end of line for multiline strings
Date: Mon, 8 Nov 2021 12:29:19 -0800
older versions of PCRE support in grep used multiline mode by default, which
seems to be required by your expression to work and is also on by default in
the regex site.

you can add it back using an internal option[1] from PCRE, as shown in the
following modified expression from your original example:

/\A(?m:\s*^(?:#\w+.*\s*|extern\s+.+)$)*+(?<namespace>\s*namespace(?:\s+utTestNamespace\s*(?>(?<block>{(?:[^{}]*(?&block)*)*}))|(\s*[\w:]*\s*{)(?&namespace)\s*}))\s*\z/

Carlo

[1] https://www.pcre.org/current/doc/html/pcre2pattern.html#internaloptions




This bug report was last modified 3 years and 255 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.