Split word detection in multiple preg_match calls
trying to scan a word query definition in one go caused pcre
to fail with PREG_JIT_STACKLIMIT_ERROR.
Instead of trying to optimize the regex simply split in two steps:
- negation detection
- escape sequence, in word negations and end of word query detection
This moves the complexity to the caller instead of pcre which used the
stack to solve the regex.
Here we simply loop.