in reply to Text comparisons

A question: do you need to have the count per function or do you want to have an aggregate value (= how many times do all of the functions together appear in the source)?

In the first case you need to have some form of variable for each function-name to keep the tally (an array or --even better-- a hash will do the trick).

In the other case, you can build one big regex (all functions names joined together with | (which is "or" in a regex) and feed your source to that regex.

Warning: there can be many subtle traps and pitfalls:

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law