The url.replace is the problem:
```
>>> url = 'https://normsetzung.cs.uni-duesseldorf.de/welcome/welcome/acode?'
>>> matches = re.search(r"\/welcome\/(\w+)\/(\w+)\?", url)
>>> for match in matches.groups():
...   url = url.replace(match, 'REPLACED')
... 
>>> url
'https://normsetzung.cs.uni-duesseldorf.de/REPLACED/REPLACED/REPLACED?'
>>> 
```

On a different note, is the question mark at the end of the regex a typo?