getLastMatch = (haystack, needle) => {
            const matches = haystack.match(needle);
            if (matches === null) {
                return;
            }

            return matches[matches.length - 1];
        }
Helper function get the last match as string
@param {string} haystack
@param {string | RegExp} needle
@returns {string | undefined}