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. Robert, that's \z. See for example http://phrogz.net/ProgrammingRuby/language.html#regularexpressionpatterns Regards, Pit