From: Peter Loftus Date: 2007-12-06T21:14:07+09:00 Subject: Re: if /hello/ =~line if /#{var1}/ =~ line when i enter # thats just comments out the whole line any reason for using # Jeremy McAnally wrote: > You can use string interpolation like you can with double quoted > strings. > > var1 = "hello" > > File.foreach "file.txt" do |line| > if /#{var1}/ =~ line > puts "found it" > break > end > end > -- Posted via http://www.ruby-forum.com/.