Home: Perl Programming Help: Beginner:
string match



kukkelikuu
New User

Dec 2, 2012, 2:05 AM


Views: 2227
string match

I need to print out all functions from c - file, which are
in forms: XXX_YYY ( or XXX_TT_SS_TT( ( so function names will have underscores and the name ends with right side brackets

How i can find the functions, i have tried something like this, but it doesnt work ( starts with letter, then there must be at least one under, and ends with brackets ):

if (/^[a-z]_{1,}[(]$/){


Chris Charley
User

Dec 2, 2012, 9:25 AM


Views: 2191
Re: [kukkelikuu] string match

I just tried this script out and it worked ok on a C file I had. To use it, you need to install some modules, including Parse-RecDescent.

Update: It won't give you the function bodies, just the signatures.


(This post was edited by Chris Charley on Dec 2, 2012, 9:39 AM)