From: Harry Kakueki Date: 2010-01-30T12:38:31+09:00 Subject: Re: How do I use a variable in a regexp search string? > > I dont know how to use a variable in a regex searchstring. > ruby seems to only handle hardcoded serachstring in > regex's.   How do you do this.   My code is below. > Does this help? str = "abcdef" searchstring = "cd" p str =~ /#{searchstring}/ Harry