Trace function calls using a regular expression