bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #37737] Contained subexpressions don't follow POSIX


From: РоманДонченко
Subject: [bug #37737] Contained subexpressions don't follow POSIX
Date: Wed, 14 Nov 2012 21:26:46 +0000
User-agent: Opera/9.80 (Windows NT 6.1; Win64; x64) Presto/2.12.388 Version/12.10

URL:
  <http://savannah.gnu.org/bugs/?37737>

                 Summary: Contained subexpressions don't follow POSIX
                 Project: grep
            Submitted by: rdonch
            Submitted on: Срд 14 Ноя 2012 21:26:45
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Here's what POSIX says
<http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html>:

9.3.6 BREs Matching Multiple Characters

<...> The string matched by a contained subexpression shall be within the
string matched by the containing subexpression. If the containing
subexpression does not match, or if there is no match for the contained
subexpression within the string matched by the containing subexpression, then
back-reference expressions corresponding to the contained subexpression shall
not match. <...> For example, <...> the expression "\(a\(b\)*\)*\2" fails to
match 'abab' <...> .

And yet...

$ src/grep '\(a\(b\)*\)*\2' <<< 'abab'
abab

I'm guessing that it assumes that \1 covers character #3, but \2 covers
character #2, which is against the spec.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?37737>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]