Many thanks.
My problem is solved.

Logan Capaldo wrote:
> On Jun 14, 2006, at 3:30 AM, Jia Zhang wrote:
> 
>>   reader.expect(/a|b/) do |str|
>>
>> -- 
>> Posted via http://www.ruby-forum.com/.
>>
> 
> Well I just looked at the source, and you can do exactly this. In
> fact, expect does you one better, if you use groups in your regexp it
> yields you those two
> 
> e.g.
> 
> reader.expect(/(a|b|c)e/) do |whole_string, first_group,
> second_group, etc|
> 
>     ...
> end


-- 
Posted via http://www.ruby-forum.com/.