Storing last match in caller's environment; adding matched substrings to match object