Trying to come up with a Regex that matches a uri path that doesn’t start with a country prefix. Following use cases are an example:
'^/$' == true
'^/es$' == false
'^/es/$' == false
'^/es/.*$' == false
'^/escro.*$' == true
'^/lies$' == true # newish
'^/lies/$' == true # newish
'^/fr$' == false
'^/fr/$' == false
'^/fr/.*$' == false
'^/freedom/$' == true
'^/it$' == false
'^/it/$' == false
'^/it/.*$' == false
'^/item/.*$' == true
'^/foo/bar/$' == true
Summary: Should match any URL that doesn’t pass “^/(fr|it|es)$” or “^/(fr|it|es)/.*$”
Here is a much more compact version that worked for me:
I used a PHP bootstrap to test it, and you can see from the demo that it passes all of the test cases.
Regex: