Use this function directly, with the `MATCH_REGEX` which included a global flag, return undefined if no match.