Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!wuarchive!psuvax1!news From: flee@guardian.cs.psu.edu (Felix Lee) Newsgroups: comp.lang.perl Subject: Re: Matching parentheses Message-ID: Date: 29 Nov 90 11:23:57 GMT References: <1990Nov28.150131.28981@ugle.unit.no> Sender: news@cs.psu.edu (Usenet) Organization: Penn State Computer Science Lines: 9 Nntp-Posting-Host: guardian.cs.psu.edu >That is, how do I get a balanced matching of parentheses? This is a job for first-class pattern objects. \balanced = *( '(' . \balanced . ')' | *[^()] ); print $string =~ \balanced; Too bad they don't exist, yet. -- Felix Lee flee@cs.psu.edu