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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -