http://www.perlmonks.org?node_id=283486

jai has asked for the wisdom of the Perl Monks concerning the following question:

hi, can anyone give me the regex to match C-style functions. given a C source file, the regex should match all the C functions and add a header b4 the function. the functions may be of the form
int function(int a, char *b) { ... return 0; }
the regex should match:
int function(int a, char *b)
and print:
------------------------------------------------------ /* Function : function() Input: int a : char *b: Output: int : Author : Date : */ int function(int a, char *b) -----------------------------------------------------------
thanks -jai