Une bvue wrote:

> i've a regexp like that :
> 
> /.*#{name}$/ === path
> 
> however the variable "name" could, for example, in the form of :
> 
> "L2 Cache (per CPU)"
> 
> then, the string "name" might contain reserved chars for regexp,
> 
> i plan to escape them replacing "(" by "\\(" etc...
> 
> however i wonder if such a function for escaping reserved chars does
> exists buit-in ???

Regexp.escape(name)

-- 
Paul Lutus
http://www.arachnoid.com