Get all matches using str.match(regex) instead of having to use str.slice