There's more than one way to do things | |
PerlMonks |
Matching parens on a regex is beating meby bfdi533 (Friar) |
on Apr 22, 2008 at 18:13 UTC ( [id://682241]=perlquestion: print w/replies, xml ) | Need Help?? |
bfdi533 has asked for the wisdom of the Perl Monks concerning the following question: I feel pretty good with my regex foo but am running into a difficult one that I could use some help on. I have a string that needs to be reformatted and it contains functions that can call functions. e.g.
But it does not matter which order they are called in. So, it could also be
So, my dilemma is that if I do a regex to find func1 and replace it then I am left with func2 to deal with. The order matters as to the matching of parens. I have not yet figured out how to get a matching () regex to work properly and have read all of the posts here already. Here is my code to date:
The problem is that I get this when I run it I get this: rather than
Just in case it is not easy to tell the difference I am getting ") END" rather than "END)". Any help or pointers on this?
Back to
Seekers of Perl Wisdom
|
|