I'm working on a way to automate comment generation for some code that I'm working on and I'm trying to extract parameters from a function declaration. I came up with the following expression:
^(private|public)?\s?(function|report)\s([^()]+)\(([^()]+)?\)(\s(returns)\s\(?([^()]+)\)?)?The expression worked on almost all functions until the parameters contained parentheses themselves, such as:
function convert_wa_date_strings(iv_beg string, iv_end string, iv_read_date date, iv_step char(6)) returns (date, date, char(1))Since the parentheses are important for the variable type they can't be ignored. The same issue occurs with the returns, but it'll be the same fix. What is it that I'm missing to capture those pesky parameters with parentheses?
Thanks!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |