public inbox for glibc-bugs-regex@sourceware.org
help / color / mirror / Atom feed
From: "eggert at cs dot ucla.edu" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs-regex@sourceware.org
Subject: [Bug regex/26653] New: regex mishandles \b inside interval expressions
Date: Wed, 23 Sep 2020 00:38:44 +0000	[thread overview]
Message-ID: <bug-26653-132@http.sourceware.org/bugzilla/> (raw)

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.

                 reply	other threads:[~2020-09-23  0:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-26653-132@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs-regex@sourceware.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).