From: Chris Hulan Date: 2011-12-26T12:23:21+09:00 Subject: Re: Scan - variable as pattern The docs for rRegexp (http://www.ruby-doc.org/core-1.9.3/Regexp.html) have a example you need str.scan /#{s}/ cheers