search: respect literal vs regex mode for NOT patterns
Created by: rvantonder
Stacked on #13755
This fixes a bug, see the test case comment while I was refactoring part of #13754. The first commit is just a mechanical refactor that inlines parseNegatedLeafNode
. Having the shared function before was good, but makes it hard to fix this easily and I also want to refactor the functions that call this function, so it is easier/better to inline the function on the way to the final refactor.
The second commit fixes the bug.