Finding functions in scripts, or code, is not easy. Here's some idea.
For C++, because functions needs to be declared in the header file and every functions end with ");", we can search ");" in the code.
For Python, search "def".
For Java, or C#, it's a bit hard. I still didn't find out a good way. For now, I'm searching ("){", ") {",")\n{")