I'm trying to write a regular expression to match all subpaths under a given path with a handful of exceptions.
The regex:
^\/my-page\/(?!.*foo|bar|baz).*
Expected behavior:
/my-page/thing1 - match!
/my-page/another-thing - match!
/my-page/foo - no match
/my-page/bar - no match
/my-page/baz - no match
This works as expected ✅
The problem:
The base path is also matched:
/my-page/ - match... but I don't want this to match. ❌
How can I adjust the regex expression to prevent /my-page/ from matching also?