Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!nuug!sigyn.idt.unit.no!ugle.unit.no!isolde!hta From: harald.alvestrand@elab-runit.sintef.no Newsgroups: comp.lang.perl Subject: Matching parentheses Message-ID: <1990Nov28.150131.28981@ugle.unit.no> Date: 28 Nov 90 15:01:31 GMT Sender: news@ugle.unit.no Reply-To: harald.alvestrand@elab-runit.sintef.no Organization: ELAB-RUNIT, SINTEF, Norway Lines: 11 I have thought a long time about this, but I am sure there must be some magic way to do it: How can I write a pattern that matches (), ((())), ((())()), but NOT ((())? That is, how do I get a balanced matching of parentheses? (or quotes, for that matter...) Harald Tveit Alvestrand Harald.Alvestrand@elab-runit.sintef.no C=no;PRMD=uninett;O=sintef;OU=elab-runit;S=alvestrand;G=harald +47 7 59 70 94