From: Josh Cheek Date: 2009-08-21T19:18:28+09:00 Subject: Re: [regexp] How to convert string "/regexp/i" to /regexp/i - ? --000e0cd356c859c3f30471a43030 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit class String def to_r Regexp.new(*strip.match(/\/(.*)\/(.*)/)[1,2]) end end "/regexp/i".to_r # => /regexp/i On Fri, Aug 21, 2009 at 4:18 AM, Joao Silva < rubyforum@thisisnotmyrealemail.com> wrote: > When i try to use: > > >> Regexp.new("/regexp/i") > => /\/regexp\/i/ > > But it's not what i want - i need: > > /regexp/i > > :-( > > How i can convert this proper way? > -- > Posted via http://www.ruby-forum.com/. > > --000e0cd356c859c3f30471a43030--