Add all_matches function

This should be used in cases where you want to match multiple instances of a pattern in  a string using regular expressions. This is instead of adding a g modifier, e.g. ```r"abc"g```.

Addresses #1487