optimize the regular expression for getting function name

get the correct function name if white space around real name