You can read perlre and perlretut. I would start with something like this, assuming all methods definition will be in one line:
while (<DATA>) { if (/^ # Matches line start \s* # None or many spaces (?:public|private)? # Matches 'public', 'private' or none (pac +kages) \s+ # One or many spaces (?:\S+) # Matches one or more non spacing chars (v +ariable type) \s+ # One or many spaces (?:\S+) # Matches one or more non spacing chars (m +ethod name) \s* # None or many spaces \( # Literal '(' (.*) # Matches everything \) # Literal ')' \s* # None or many spaces $ # Matches end of line /x) { print $1, "\n"; } } __DATA__ public void check1(String str, Integer i) { }
Igor 'izut' Sutton
your code, your rules.
In reply to Re: getting count of method params
by izut
in thread getting count of method params
by neeha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |