I have a regex ^\/pref1\/pref2\/v.+\/(search)(\/.*)?$ it is matching for instance /pref1/pref2/v1/search/suf1/suf2.
But I want it to match anything that doesn't contain word search in that place. To achieve that I have modified regex by adding negative lookahead:
^\/pref1\/pref2\/v.+\/(?!search)(\/.*)?$
but then this for instance doesn't match:
/pref1/pref2/v1/somethingElse/suf1/suf2
but it should as somethingElse not equals search. How to fix that?