From: Martin DeMello Date: 2006-10-17T14:40:33+09:00 Subject: Re: Ruby Regexp vs Perl and C# On 10/16/06, Chris Meyers wrote: > > line="banana" > line.scan(/(an)*/) { > puts $` + "<<" + $& + ">>" + $' + "\n" > } Also, if you do a require 'English' you can write that as puts $PREMATCH + "<<" + $MATCH + ">>" + $POSTMATCH (you don't need the explicit \n if you're using puts) martin