[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lowercase letters for binaries
From: |
Benno Schulenberg |
Subject: |
Re: lowercase letters for binaries |
Date: |
Mon, 07 Nov 2005 21:40:49 +0100 |
User-agent: |
KMail/1.8.3 |
Andreas Schwab wrote:
> 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.
Ah. That "previously matched" is what I hadn't understood -- and
this is precisely what point 13 tries to explain. So maybe the
following is a better text for 'info grep usage':
13. Why is this back-reference failing?
echo "ba" | egrep '(a)\1|b\1'
This gives no output, because the first alternate '(a)\1' does
not match, as there is no "aa" in the input, so the '\1' in the
second alternate has nothing to refer back to, meaning it will
never match anything. (The second alternate in this example
can only match if the first alternate has matched -- making
the second one superfluous.)
Benno
- lowercase letters for binaries, Benno Schulenberg, 2005/11/06
- Re: lowercase letters for binaries, Charles Levert, 2005/11/06
- Re: lowercase letters for binaries, Benno Schulenberg, 2005/11/06
- Re: lowercase letters for binaries, Andreas Schwab, 2005/11/06
- Re: lowercase letters for binaries, Charles Levert, 2005/11/06
- Re: lowercase letters for binaries, Andreas Schwab, 2005/11/06
- Re: lowercase letters for binaries, Charles Levert, 2005/11/06
- Re: lowercase letters for binaries, Julian Foad, 2005/11/06
- Re: lowercase letters for binaries, Charles Levert, 2005/11/07
- Re: lowercase letters for binaries, Andreas Schwab, 2005/11/07
- Re: lowercase letters for binaries,
Benno Schulenberg <=
- Re: lowercase letters for binaries, Charles Levert, 2005/11/07
- Re: lowercase letters for binaries, Julian Foad, 2005/11/08