I'd like to programatically find all javascript functions and add some code for profiling purposes (to count how many times they are called). Is there any existing tool or a regex to do that?
It is relatively easy to write something like:
function\s+\w+\(.*?\)\s*{
But that only begins to cover the multitude of options.