in reply to Regular Expressions
You are essentially asking Perl to match one or more digits, followed by another single digit that is equal to what it just matched. That means for the overall match to work, it needs to find two consecutive identical digits. The only place you have two equal digits are near the end of your string; '111'. The '$' anchors \1 to the right hand side of the string, so basically the last two 1's are being matched.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular Expressions
by Anonymous Monk on May 17, 2005 at 20:34 UTC |