I have this regex:
(?:(?:AND\sNOT|AND|OR)(?!.*(?:AND\sNOT|AND|OR))\s)(.*)
What I want is to get the last key:value pair, example -
k:v AND k1:v1 AND NOT k2:v2 OR k3:v3
I want the regex to match k3:v3, and it does, but it doesn't match the key:value in the next situation -
k:v
I need it to match the key:value pair even if it's the first one and there's no operators brefore...
update: key:value is not the issue here, I need it to match everything after the last operator
update 2: tried to do the following -
(?:(?:AND\sNOT|AND|OR)?(?!.*(?:AND\sNOT|AND|OR))\s)(.*)
(?:(?:AND\sNOT|AND|OR?)(?!.*(?:AND\sNOT|AND|OR))\s)(.*)
didn't work