From: "Lucas W." Date: 2012-01-21T06:15:42+09:00 Subject: Re: [regexp] How to convert string "/regexp/i" to /regexp/i - ? In the spirit of http://xkcd.com/979/ here's a better answer: http://rubygems.org/gems/to_regexp This gem solves the problem. Source: http://stackoverflow.com/questions/6669425/convert-a-regular-expression-in-a-string-to-a-regexp-object-in-ruby/6669653#6669653 Once this gem is installed, you can call String#to_regexp and all is well. -- Posted via http://www.ruby-forum.com/.