Support to replace groups

We have the need to strip elements from urls:

/test/a --> /a

Therefore we need to be able to replace groups in expressions:

 '^/test/(.*)$ /$1'

This change makes that possible.