From: Harald Eilertsen Date: 2008-12-04T16:49:11+09:00 Subject: Re: Looking for a pattern 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!