perlquestion
marksman
Hi,<br>
I'm writing a Perl script to read in Perl code and extract all calls to Mod::func(). <br>Mod::func() might take any number of arguments with strings and funny characters and newlines and such.
<br><br>
Right now, I have this regexp:
<code>use Regexp::Common qw(balanced);
m/Mod::func\s*$RE{balanced}{-parens=>'()'}\s*;/g</code>
It works well, except that calls like this break it:<br>
<code>Mod::func( ")" );</code><br>
Namely, strings that have unbalanced parentheses.
<br><br>
Any advice on how to improve this regexp, or another course to pursue?
<br>
Thanks.<br>