James Gray
2/17/2005 11:13:00 PM
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