Nevertheless, the workarounds to eliminate backtracking that I gave sped up the search and replace dramatically.
Regards, JJ
On 19-Jan-2006, at 18:23, Sune Foldager wrote:
On 18/01/2006, at 16:47, John Johnson wrote:
Sounds like a classic case of the regexp engine doing backtracking.
Yes, but then again his simple regex, replacing \n, doesn't have any + or *, so it shouldn't be a problem.
The regexp engine searches forward until it matches the regexp. Then it begins searching backward from the end of the file, until the regexp matches as much as possible.
I'm pretty sure it doesn't do this, but searches forward until it found the largest match. But regardles of that, in this case there is only one character to match.
-- Sune.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
--- Help everyone. If you can't do that, then at least be nice.