On Thu, Jul 19, 2007 at 09:14:59AM +0900, ryemcdonald / 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. <marcel / vernix.org>