Applies a regular expression (regex) to a string and returns information on the all matched substrings.