Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Parsing... possible w/o too much stress ?

by broquaint (Abbot)
on Mar 19, 2003 at 13:43 UTC ( [id://244334]=note: print w/replies, xml ) Need Help??


in reply to Parsing... possible w/o too much stress ?

Thus my question: what is the easiest way to handle it?
If it's really a simple matter of matching braces then you could indeed use a regex
use Regexp::Common; my $str = <<CODE; env { foo { bar {} } } CODE print $str =~ /($RE{balanced}{-parens => '{}'})/; __output__ { foo { bar {} } }
Check out Re: Graph File Parsing for some regex style parsing, or if you'd prefer to stay away from regexes there's always Text::Balanced.
HTH

_________
broquaint

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://244334]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 19:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found