I am trying to match below path with a regex.
# test-site could be anything like "shoe-site", "best-clock", etc.
/content/test-site
The current regex rule (\/content\/{1}\S+)
would have been adequate.
The problem is it is matching the entire path such as /content/test-site/en_US/abc.html
.
I need it to match only /content/test-site
.
Example of path to be matched:
https://localhost:4502/content/test-site/en_US/book/city/sample-rooms/airport-inn/propertyCode.00000.html
Regex I've tried by far;
(\/content\/[a-z-]+)\/[a-z]{2}_[A-Z]{2}\/book(ing-path)?\/(sample-|sample-details)(.*).[0-9]{5}.*
/content/test-site is optional- it might not present sometimes in url.
What am I doing wrong and how can I fix it?