public inbox for glibc-bugs-regex@sourceware.org
help / color / mirror / Atom feed
* [Bug regex/26653] New: regex mishandles \b inside interval expressions
@ 2020-09-23  0:38 eggert at cs dot ucla.edu
  0 siblings, 0 replies; only message in thread
From: eggert at cs dot ucla.edu @ 2020-09-23  0:38 UTC (permalink / raw)
  To: glibc-bugs-regex

https://sourceware.org/bugzilla/show_bug.cgi?id=26653

            Bug ID: 26653
           Summary: regex mishandles \b inside interval expressions
           Product: glibc
           Version: 2.32
            Status: NEW
          Severity: normal
          Priority: P2
         Component: regex
          Assignee: unassigned at sourceware dot org
          Reporter: eggert at cs dot ucla.edu
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 12855
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12855&action=edit
test program illustrating the \b-inside-interval regex bug

The glibc regular expression code mishandles extended regular expressions such
as:

  (.*\band){2}

although it correctly processes equivalent expressions such as:

  (.*(\<|\>)and){2}

There is a similar problem with the same regular expression in BRE syntax:

  \(.*\band\)\{2\}

To reproduce the problem, compile and run the attached file b-interval-bug.c.
It will exit with status 1, whereas the correct exit status is 0.

This bug was reported against GNU 'sed' here:

https://bugs.gnu.org/41558

and the original posting is from StackExchange, here:

https://unix.stackexchange.com/questions/579889/why-doesnt-this-sed-command-replace-the-3rd-to-last-and

The original posting mentions backreferences but the bug occurs even without
backreferences.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-23  0:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23  0:38 [Bug regex/26653] New: regex mishandles \b inside interval expressions eggert at cs dot ucla.edu

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 read-only IMAP folder(s) and NNTP newsgroup(s).