Fix an issue in the regex used to parse functions