From: "Pena, Botp" Date: 2008-12-12T12:13:58+09:00 Subject: Re: problems in String type argument for Regular Expression From: Jun Young Kim [mailto:jykim@altibase.com] # I mean I have a regular expression as a string. # puts aPattern # => "/[aeiou]/" # When I convert it as a Regexp instance, the result is # => /\/[aeiou]\// # At this point, the given regular pattern is not regular expression # anymore, it's just a string. it is stil a regex, not just the regex that you expected though. you can either remove the surrounding slashes s="/[aeiou]/" Regexp.new s[1..-2] #=> /[aeiou]/ or you can just eval it straight away eval(s) #=> /[aeiou]/