Request: get a specific segment of URL related to Language and add it as a query string, plus stripping of first 2 segments of the incoming URL:
Group 1: language (which becomes QS) Group 2: second part of the URL to be maintained Group 3: Question mark "?" which needs to be removed Group 4: Query strings which needs to be maintained
Example: /en-US/cms/api/preview/pippo/paperino/pluto/DePaperoni/paperoga?qui=qua&quo=qui&cap-paperopoli=123#user=Artibani
Transformation: /preview/$2?lang=$1&$4
Output: /preview/pippo/paperino/pluto/DePaperoni/paperoga?lang=en-US&qui=qua&quo=qui&cap-paperopoli=123#user=Artibani