Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Elegant examples to parse parenthesised strings (Parse::Balanced)

by repellent (Priest)
on May 26, 2010 at 22:44 UTC ( [id://841840]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Elegant examples to parse parenthesised strings (Parse::Balanced)
in thread Elegant examples to parse parenthesised strings

Add an "escape" token for those function calls:
@tokens = ( "(", qr/(?:[ab]func\([^)]*\))/, \@tokens, ")" );

Parsing contents in-between the function call parentheses is left as an exercise.

By the way, your second $str is unbalanced.

Log In?
Username:
Password:

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

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

    No recent polls found