|The stupid question is the question not asked|
Answer: How do i find $a and replace it with $b when it's preceded by $c?
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: