From: Timothy Hunter Date: 2005-08-17T07:31:14+09:00 Subject: Re: YAENQ: Variable as a pattern basi wrote: > (I ordered for a copy of Mastering Regular Expressions. Should be in my > snail mailbox anytime soon. In the meantime ... ) > > How do I tell Ruby to use the content of a variable as the pattern, > rather than interpreting the variable name as a literal? > > > v = "aeiou" > > Then, in > > "goodness" =~ /[v]/ > > I'd like v to be interepreted not as a literal but as a variable name. > > Thanks > basi > "goodness" =~ /#{v}/