One option I saw in StackOverflow somewhere was to make the "end" of the regex be something that searched for common keywords that are used normally to denote the beginning of the *next* function and key off of that. For instance, the next time it hits "public" or "private" or "static" or somesuch. Can you think of situations in which that might fail?
_________________________
Tony Fabris