On Jul 18, 5:18 pm, "Marcel Molina Jr." <mar... / vernix.org> wrote:
> On Thu, Jul 19, 2007 at 09:14:59AM +0900, ryemcdon... / gmail.com wrote:
> > Is there a *better* way to perform multiple substitutions to a string
> > than this?
>
> > string = '/../../....//........////../../etc/passwd'
>
> > while string.gsub!(/\.\.\//,'')
> > end
>
> irb(main):001:>> string = '/../../....//........////../../etc/passwd'
> => "/../../....//........////../../etc/passwd"
> irb(main):002:0> File.expand_path(string)
> => "/etc/passwd"
>
> marcel
> --
> Marcel Molina Jr. <mar... / vernix.org>

that's great! thank you