I have a URL pattern that looks like this: ^foo\/(?P<prefix>[a-z]+)\/bar\/$.
I need the sequence of characters in the middle to be different than another sequence of characters, let's say ab.
foo/somestring/bar/ and foo/abcde/bar/ should match, but foo/ab/bar/ should not.
I've come as far as ^foo\/(?P<prefix>(?!ab)[a-z]+)\/bar\/$, but that doesn't match foo/abcde/bar/.