Helper function to split string into groups based on regexp. Possibility to retrieve...