It is possible to implement it in either C# or Java, but a Regex will not be sufficient: there are far, far too many varieties of method signature (and other code) that you need to deal with to make a regular expression viable.
Instead, look at finding a C++ parser in your prefered language and see what you can do with that - it's a major job to produce your own!
Google will help:
C++ parser - Google Search[
^] is a starting point.