I was just rolling my own little thread about gsub ;]
and trying to fix my stupid regexen when
I came up with the perfect solution to replace the last occurence of a
pattern (if it is simple, thus not of any interest to the OP of the OT).
is almost three times as fast (to my surprise), only that it does not work
if there are newlines in the string, they match $.
Is there a way to anchor on the end of the string in multiline strings.
Just didn't find it.
Ty in advance
Robert
···
--
Deux choses sont infinies : l'univers et la bêtise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.
I came up with the perfect solution to replace the last occurence of a
pattern (if it is simple, thus not of any interest to the OP of the OT).
(...)
Is there a way to anchor on the end of the string in multiline strings.
Thanks I *should* have found it, but of course now reverse.sub.reverse is
much faster again !!!
Nevertheless it behaves correctly and reasonably fast.
Thanks again.
Robert
···
On 7/27/06, Pit Capitain <pit@capitain.de> wrote:
Robert Dober schrieb:
> I came up with the perfect solution to replace the last occurence of a
> pattern (if it is simple, thus not of any interest to the OP of the OT).
> (...)
> Is there a way to anchor on the end of the string in multiline strings.