From: dblack@... Date: 2002-10-26T20:06:56+09:00 Subject: Re: How to return multiple matches in Regexp? Hi -- On Sat, 26 Oct 2002, Carl Youngblood wrote: > I'm used to the perl modifier /.../g that makes sure that a regexp > matches as many occurrences as possible. How do you do this in Ruby? See Holden's reference to gsub; but also, if you don't need to sub anything, there's String#scan: ruby -e 'p "one two three".scan(/\w+/)' ["one", "two", "three"] David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav