From: James Edward Gray II Date: 2005-02-18T08:12:49+09:00 Subject: Re: Regular expression question? On Feb 17, 2005, at 5:09 PM, Lei Wu wrote: > Hi, > > I want to translate the following Perl code into Ruby: > > @captures = ($text =~ /company=(.+)/g) > > Basically, the Perl version uses the g modifier to capture all > occurrence of the matches in () and put them into an array. > > How do I do this in Ruby? captures = text.scan(/company=(.+)/) Hope that helps. James Edward Gray II