matt neuburg <matt / tidbits.com> wrote:

> Chris Meyers <chrismmeyers / hotmail.com> wrote:
> 
> > how do you do multiple matches in Ruby with full match information?
> 
> gsub

In fact you could effectively write it exactly as you did it in Perl:

"banana".gsub(/(an)*/) {
  puts $` + "<<" + $& + ">>" + $'
}

m.



-- 
matt neuburg, phd = matt / tidbits.com, http://www.tidbits.com/matt/
Tiger - http://www.takecontrolbooks.com/tiger-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com