From: "Marcin Mielżyński" Date: 2006-02-03T23:08:20+09:00 Subject: Re: problem with regexp? Wmute wrote: > > if line =~/($time)/ && line =~/(xxx)/ > > in Ruby $.. wont reference a variable like in perl, use #{...} if line =~ /#{time}/ && line =~ /(xxx)/ .... in case of /#{(time)}/ regexp will be compiled each time... so you may consider: r = /#{time}/ , or: r = Regexp.new(time) .... probably some loop .... if line =~ r && ... lopex