Yes, that's what I meant.
The kind of thing that (surprisingly) works is
s/(pattern)/---toremove---$1/q
s/---toremove---//q
The second one should obviously use the n flag, but even with a regex it
works. I also tried with the second string longer or shorter, and it
always works (at least on my test page).
Can I really consider this as safe?
Thanks,
Nick
Ruediger Pluem wrote:
On 06/10/2009 06:18 PM, Nick Gearls wrote:
Hi Nick,
Do you mean that mod_sed should be used instead of mod_substitute?
Because it is more complete, or more mature? I only need the substitution.
About the flattening: is the q flag only needed if you want to use two
subst on the same line with overlapping between them?
It's the other way round: If you have two subst with overlappings using the
q flag might result in missing substitutions. As this does not seem to be the
case for your problem it is safe (and good) to use it as it solves your memory
problem.
Regards
RĂ¼diger