From: Robert Dober Date: 2006-07-27T20:28:15+09:00 Subject: Re: Positive lookahead in multiline strings (was gsub) ------=_Part_39630_20128236.1153999692393 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 7/27/06, Pit Capitain 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. > > Robert, that's \z. See for example > > http://phrogz.net/ProgrammingRuby/language.html#regularexpressionpatterns > > Regards, > Pit > > 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 --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_39630_20128236.1153999692393--