From: Zhao Yi Date: 2008-12-04T16:53:12+09:00 Subject: Re: Looking for a pattern Harald Eilertsen wrote: > Zhao Yi wrote: > >> I am looking for a pattern to match the last underline and its following >> string with "####". for example, >> >> "abc_def_ghi" => "abc_def####" > > "abc_def_ghi".match(/_[^_]*$/) > > That should do the trick, shouldn't it? > > H! Yes, very good. thanks. -- Posted via http://www.ruby-forum.com/.