From: 7stud -- Date: 2012-10-29T10:18:43+09:00 Subject: Re: Newbie : Regular expression r = 'hello' str = 'hello' if Regexp.new("(^#{r}$)").match str puts "Yep" puts $1 end --output:-- Yep hello -- Posted via http://www.ruby-forum.com/.