------ art_276515_25553695.1154049052726
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
marker ***'
code <-EOT
var x
//*** hello
function foo() {}
EOT
p code.to_a.grep(/\*\*\*/) # -> ["//*** hello\n"] that's what I
want but using marker
#p code.to_a.grep(/#{marker}/) # -> invalid regexp error
p code.to_a.grep(/#{%q(marker)}/) # -> [], doesn't work
In perl you can do /\Q$marker/ and it escapes $marker for the regexp.
Simon.
--
Simon Baird <simon.baird / gmail.com>
------ art_276515_25553695.1154049052726--