bug-grep
[Top][All Lists]
Advanced

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

Re: lowercase letters for binaries


From: Andreas Schwab
Subject: Re: lowercase letters for binaries
Date: Sun, 06 Nov 2005 22:48:30 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

Benno Schulenberg <address@hidden> writes:

> Hmm...  I'm not sure that backreferences are working correctly.  
> Shouldn't
>
>   echo "cbaa" | egrep '(aa)cb|cb\1'
>
> give output?

Since (aa) does not match anything, what should \1 match?  Note that a
back-reference does not repeat the matching of the referenced
subexpression, but only matches the exact string that was previously
matched.

>  This does:
>
>   echo "cbaa" | egrep '(aa)cb|cb(a)\2'

Note that POSIX does not allow back-references in EREs, only in BREs which
don't have alternation.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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