The regex used for getting function name improved