Today I learned how I can use the method 'groupdict' from a regex match to get a dictionary with all named groups.
Thank you @abrudz for helping me style this.