Charles Levert wrote:
* On Monday 2005-11-07 at 21:40:49 +0100, Benno Schulenberg wrote:
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.)
I like it.
Me too, so I've committed it, along with your tweak to example 14. Thanks,
Benno.
- Julian