Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

perlfaq6: Can I use Perl regular expressions to match balanced text?

by brian_d_foy (Abbot)
on Jan 03, 2008 at 20:39 UTC ( #660316=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    I have some <brackets in <nested brackets> > and
    <another group <nested once <nested twice> > >
    and that's it.
    
  2. or download this
    #!/usr/local/bin/perl5.10.0
    
    ...
    
    $" = "\n\t";
    print "Found:\n\t@groups\n";
    
  3. or download this
    Found:
        <brackets in <nested brackets> >
        <another group <nested once <nested twice> > >
    
  4. or download this
    #!/usr/local/bin/perl5.10.0
        
    ...
        
        unshift @queue, map { s/^<//; s/>$//; $_ } @groups;
        }
    
  5. or download this
    Found:
        <brackets in <nested brackets> >
    ...
    
    Found:
        <nested twice>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://660316]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (18)
As of 2015-07-31 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls