From: Austin Ziegler Date: 2006-12-12T06:36:16+09:00 Subject: Re: Is there something like Regexp#match_all On 12/11/06, Andi Schacke wrote: > is there a possibility to return all the matches of a regexp? or in > other words is there a way to apply a block to all matches at once? > Something like String#gsub but where I can specifiy what to do with the > matches... These things are actually two different things. 1. Look at String#scan 2. Look at String#gsub with the block form and use Regexp::last_match (it's a thread-local value, IIRC). -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca