String#scan does it.

----- Original Message ----- 
From: "Shannon Fang" <xrfang / hotmail.com>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Friday, December 06, 2002 1:26 PM
Subject: regexp reference


> Please help me with the following problem:
> 
> / (  ( a ) ( b ) ) (c)/
>   1  2      3       4
> 
> in Match Data, it seems that $1.. $4 are defined as above. How can I let
> regex.match(string) method to return an array like this:
> 
> [ [a,b], c] ?
> 
> Thanks!
> Shannon
> 
> 
> 
> 
>