Is is possible to create/use a regular expression pattern in ruby that is based on the value of a variable name?
For instance, we all know we can do the following wi
You can use regular expressions through variables in ruby:
var = /Value/ str = "a test Value" str.gsub( /#{var}/, 'foo' )