Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-09-18 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (109 votes), past polls