Do you know where your variables are? | |
PerlMonks |
Help modifying recursive regexby beeflobill (Initiate) |
on May 07, 2013 at 18:41 UTC ( [id://1032522]=perlquestion: print w/replies, xml ) | Need Help?? |
beeflobill has asked for the wisdom of the Perl Monks concerning the following question: A long time ago I worked really hard and wrote a piece of recursive regex code which I'm trying to modify now. It takes text with nested parentheses and returns a list with the "top" groups of parentheses.
Here is an example which shows what the regex does:
Even when I wrote the code I knew I would really, really want to keep the data that wasn't in parentheses too, but I couldn't figure out how to do it. Now I'm back on the problem.
Here is an example of what I am trying to get:
I still don't know how to do that. I've provided a test script demonstrating the subroutine that does what I'm describing. May I supplicate, how might I modify this to do what I need? Or, is there simply a better way to approach this problem? Thanks.
Back to
Seekers of Perl Wisdom
|
|