From: Kristof Bastiaensen Date: 2004-04-26T21:14:08+09:00 Subject: Re: Variable matching On Mon, 26 Apr 2004 20:25:20 +0900, Rove Monteux wrote: > Hi, > > $start = "" > $end = "" > > chunk = content.scan(/$start(.*)$end/m) > > Obviously that doesnt works, suppose because of $ being a special > variable ? Ehm, no, $ in a regexp means itself, or the end if used at the end of the regexp. $ in a string means just $. If you want variable replacement, use #{ expression }. Try this: > chunk = content.scan(/#{start}(.*)#{end}/m) Kristof