bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: grep -e '\(a\)\1' -e '\(b\)\1'


From: Alain Magloire
Subject: Re: grep -e '\(a\)\1' -e '\(b\)\1'
Date: Fri, 16 Feb 2001 11:18:47 -0500 (EST)

> 
> Tapani Tarvainen <address@hidden> wrote:
> 
> > The grep command in the subject line doesn't work
> > correctly with Gnu grep 2.4: it fails to match 'bb'.

2.4.2 is the latest.

> 
> Looks like pilot error, to me:
> 
> $ echo bb | grep -e '\(a\)\1' -e '\(b\)\2'
> bb

After consulting with the gurus on what the wording of the POSIX
std.  This is actually an error, for multiple regex the backref
should be local.

It will be fix on the next release.

> > Same problem with egrep '(a)\1|(b)\1'.
> 
> $ echo bb | egrep '(a)\1|(b)\2'
> bb

Correct.
Note that according to POSIX.  '\' backref are undefined when use
with Extended RE. Meaning a conforming implementation can choose to
see '1' for '\1'.

Note: Guglielmo Bondioni pointed this to me but I had my hands full last
year.

-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on n'est toujours assis que sur son cul !!!




reply via email to

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