Perl - Pattern contains new line -
i trying grab functions c file in perl script.
pattern example :
function return type function name (function parameters) { so far have: m/^(.*)\((.*)\)/
but grabs functions inside well, such if statements, hoping match { since eliminate internal functions m/^(.*)\((.*)\)/\n\{/ doesn't work.
how match \n{ i.e { in next line, can catch
add(int a, int b) { ... avoid, say
if(a = b)
there no asterisks want match in c source. therefore, remove backslashes before asterisks in pattern.
the following might closer want:
m/^(.*?\(.*?\))\s*\n{/m
Comments
Post a Comment