Hello I am trying to create a regex that will match on the following
/go/brand
but not match
/go/brand/anotherpage
I was thinking that I could use something like the following
^go/([_0-9a-z-]+)(?!/)
where I don’t match anything that has a slash after brand (brand can by dynamic). Any help would be greatly appreciated.
Try adding an end-of-string anchor:
This works for me in RegExr, but perhaps your URL rewriting regex engine has additional nuances you’ll need to accommodate.