I have found many similar questions that do not work with the Go regex syntax.
The string that I am attempting to match against is in the form of anything/anything/somestring
. With the pattern \/.*\/.*\/(.*)
, I will match somestring
, but I am trying to match anything except strings that contain somestring
.
Most answers propose using something like \/.*\/.*\/((?!somestring).*)
, however in golang regexp I get: ? The preceding token is not quantifiable
.
For clarification: /test/test/MATCH
would produce a match while /test/test/somestring
would not. Is this possible with the (limited) Go regex syntax?