in reply to Re^4: How we can separate a backref from a digit?
in thread How we can separate a backref from a digit?
FWIW: I now think that the "proper" way to do this is /(a)\1[1]$ because I seem to recall that circa 5.8.3 or 5.8.4, code was specifically added to the regex engine to cause character classes that contained a single character to be optimised away to that character. This was done because explicitly because it makes the use of the construct as an escaping mechanism so useful and clear.
Ie. /[f][r][e][d]/ becomes exactly equivalent to /fred/, including its runtime performance.
Maybe someone out there has a reference to the change, I looked but could not find it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How we can separate a backref from a digit?
by JavaFan (Canon) on Mar 18, 2011 at 22:54 UTC | |
by BrowserUk (Patriarch) on Mar 18, 2011 at 23:05 UTC | |
|
Re^6: How we can separate a backref from a digit?
by ikegami (Patriarch) on Mar 18, 2011 at 23:24 UTC | |
by BrowserUk (Patriarch) on Mar 19, 2011 at 00:10 UTC | |
by ikegami (Patriarch) on Mar 19, 2011 at 04:45 UTC | |
by BrowserUk (Patriarch) on Mar 19, 2011 at 05:08 UTC | |
by ikegami (Patriarch) on Mar 19, 2011 at 06:21 UTC |