I am trying to match the last segment of a URL if and only if it is not preceded by a specific segment ('news-events'). So, for example, I would like to map "my-slug" here:
http:
... but not here:
http:
I work with javascript - tried something like this:
\b(?!news-events)(\/\w+)\b$
... but the word boundary approach does not work here, since / char serves as the boundary between segments (therefore, the last segment is selected, regardless of whether it is preceded by "news events".
Any thoughts would be appreciated.
Thank you very much.
source share