Read that claim again; it says that the finite-automata approach beats
the backtracking implementations. Except for backreferences.
It doesn't say that a slow, backtracking regex has to be used if
backreferences are to be supported.
Section 4 of this paper <
http://www.arl.wustl.edu/~pcrowley/a25-becchi.pdf>
discusses ways of retrofitting backreferencing support into NFA-based
regex processing. Another possibility is that the regex compiler can
choose the pure automaton strategy when the regex doesn't actually
use backreferencing, so you don't have to "pay for what you don't use".
But anyway, none of that matters, because I suspect you may be confusing
register references in the edit replacement sequence with
regex backreferences!
Backreference support means that \1, \2, ... may occur *in the regex
itself*. For instance (.*)X\1 means "match some stuff until an X,
followed by that same stuff".
When the replacement sequence is being processed, the regex matching is
done. Then the register references \1, \2, ... just refer to the matched
material; they are not involved in the pattern matching itself.
--
TXR Programming Lanuage:
http://nongnu.org/txr
Music DIY Mailing List:
http://www.kylheku.com/diy
ADA MP-1 Mailing List:
http://www.kylheku.com/mp1