> I'm not entirely sure I understand the problem.
> Specifically, what's wrong with the /(?<!(prime ))minister/i
> you gave? If by "I don't want to match minister on the
> above" you mean that you don't want that pattern to match
> itself (that is, "prime ))minister" is close enough to "prime
> minister" for you to want it ruled out), then you don't just
> want to rule out "prime minister", but something more like
> "prime.*minister" or "prime\W+minister" or something. The
> first step is always figuring out what it really is you want.
> Then you can pretty easily change it.
>
> /(?<!prime\W*)minister/i
>
> for instance
> --
For one, you cant use regex for negative lookbehind rules (I'm not exactly clear on why, but it has something to do with the way regex works under the hood). Secondly, for some reason, negative lookbehind rules return the non-matching set (I think) so the rule above, if it could work, would return true on minister (not exactly sure why this does this either but I read it somewhere).
Because the above rule returns true the word minister, I cannot use it. I want to score 2 points on minister where it is not preceded by prime. The above rule will hit on minister or prime minister.
