I'm trying to do a substitution with regular expressions in which the values to substitute are taken from a hash, prefixed and suffixed with a '%' and then the value of the hash is used to replace the tag. The code is as follows: template = "Replace %foo% whereever %foo% is" searchValue="%foo%" puts template.gsub(/searchValue/,'blah') This does not seem to work? Can Ruby use variables in its expressions for regex?? B. _______________________________________________________ Do You Yahoo!? Get your free @yahoo.ca address at http://mail.yahoo.ca