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

                 Summary: Error parsing a pattern including "( ??? |+)"
                 Project: grep
            Submitted by: asenci
            Submitted on: Thu 10 Feb 2011 11:18:11 AM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Trying to run grep with Extended Regex and a pattern including "( ??? |+)"
causes a parsing error on version 2.6.3. The issue couldn't be reproduced in
version 2.5.1.

It seams the plus is qualifying the pipe, so it's trying to match a string
with one or more pipes (|, ||, |||, ...).


$ grep -V
GNU grep 2.6.3

Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ echo "-RA" | grep -Eq '^(-|+)RA$' && echo OK
grep: Unmatched ) or \)
$ echo "-RA" | grep -Eq '^(+|-)RA$' && echo OK
OK
$ echo "-RA" | grep -Eq '^(-|\+)RA$' && echo OK
OK


$ grep -V
grep (GNU grep) 2.5.1

Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ echo "-RA" | grep -Eq '^(-|+)RA$' && echo OK
OK
$ echo "-RA" | grep -Eq '^(+|-)RA$' && echo OK
OK




    _______________________________________________________

Reply to this item at:

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

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


Reply via email to