I have this regex in Python
import re
regex = '(?P<name>[\w\-+\.&\s]+)[\s\-]+(?P<form>GmbH & Co\. KG|KG)'
print(re.match(regex, "Test GmbH & Co. KG").groupdict())
This will return
{'name': 'Test GmbH & Co.', 'form': 'KG'}
But I'd like
{'name': 'Test', 'form': ' GmbH & Co. KG'}
I am thinking about making the first capture group non-matching if there is a match in the second group. Another idea was to somehow instruct the regex engine to start at the end. Also fiddled around with greedy and lazy modifiers. But I am a noob with regexes and could really need a hint.