Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: capturing matching parenthesis

by melora (Scribe)
on Apr 16, 2004 at 17:59 UTC ( [id://345834]=note: print w/replies, xml ) Need Help??


in reply to capturing matching parenthesis

The times I've had to cope with nested parentheses, I've used recursion -- call the recursion routine when you encounter the open paren (excellent point about the "\(" sequence, by the way), and return when you encounter the close paren (of course, there's the escape sequence there, too), resuming at the point beyond the close paren, in the original string.. I do like the idea of populating the tree structure with it, too, depending on the analysis you need to do on the whole expression. But then, I'm an old C programmer.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-18 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found