I have been struggling and testing for the last two hours and simply cannot wrap my head around the whole RegEx-stuff enough in order to find a proper solution to this...
I am trying to redirect a couple of URLs from our old site to the new one due to a recent re-launch.
This is the current state of things / a demo of my RegEx
Essentially it looks like this:
.+(\/es|\/de|\/en)?\/(legal)(.+)?
My problem is that a URL like https://example.com/es/projects/legal-yeah
is also being matched, which does make sense looking at the rule but is not what I want to achieve...
How can I perform a test which only matches URLs where there is nothing in between the first part for the language string (de/en/es/empty) and the second part (/legal)?
Thanks so much for sharing your thoughts on this, appreciate it!