|XP is just a number|
Answer: How do i find $a and replace it with $b when it's preceded by $c?by btrott (Parson)
|on Jun 13, 2000 at 22:31 UTC||Need Help??|
Q&A > regular expressions > How do i find $a and replace it with $b when it's preceded by $c? - Answer contributed by btrott
Here is chromatic's post to which btrott is responding.
I prefer a simpler approach:
Am I missing anything the lookbehind provides?
All right... here's a benchmark of the two methods (lookbehind and just straight substitution). It looks like lookbehind is slightly faster, but not by a huge lot. Here's the code:
And here are the benchmark results: