Or try Text::Balanced
In reply to Re: Re: Extract lines of .java by steves in thread Extract lines of .java by knobbled