Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!sei.cmu.edu!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!jb3o+ From: jb3o+@andrew.cmu.edu (Jon Allen Boone) Newsgroups: comp.lang.perl Subject: Re: Perl-Users Digest #651 Message-ID: Date: 11 Mar 91 14:41:52 GMT References: <1991Mar9.230553.22037@uvaarpa.Virginia.EDU> Organization: Carnegie Mellon, Pittsburgh, PA Lines: 29 In-Reply-To: <1991Mar9.230553.22037@uvaarpa.Virginia.EDU> > Excerpts from netnews.comp.lang.perl: 9-Mar-91 Re: Perl-Users Digest > #651 Marc Horowitz@ATHENA.MIT (884) > Ok, that explains it, but it doesn't excuse it. Sometimes I want to > match an expression complex enough (like Ed's example) that I need > more than nine () to group everything. In this case, perl should > still work, and I would say that the regexp in an array context should > contain as many elements as paren pairs, but that $1 .. $9 should > contain the first nine () matches. > Comments? > Marc we need another (what, ANOTHER?) "special variable" to hold the contents of a regexp pattern - $1 .. $9 would, like Marc said, hold the first 9 ()'s, but you could shift and unshift the variable to make $1 .. $9 change. how about @PAT ? @PAT Contains the last pattern matched - $1 .. $9 contain the first nine ()'s in @PAT, $+ contains the last bracket matched by @PAT. - jon -