I have a question with this string and regexp
FROM ofertas where ofertas.cod_ofer != 0 and soyprospecto = 0 and ofertas.cod_ofer in([inicioid]select keyofe from seguimiento where keytiposeg=45 and fechaaviso BETWEEN '2022-05-02 00:00:00' AND '2022-06-01 23:59:59' group by keyofe[finid]) where AND ofertas.keyagente in(2) [inicioid]select keyofe from seguimiento where keytiposeg=45 and fechaaviso BETWEEN '2022-05-02 00:00:00' AND '2022-06-01 23:59:59' group by keyofe[finid] where asdfas dfsa
and i want to capture all words "where", but not if are between [inicioid] and [finid]
bold "where" are that i want to capture. Example:
FROM ofertas where ofertas.cod_ofer != 0 and soyprospecto = 0 and ofertas.cod_ofer in([inicioid]select keyofe from seguimiento where keytiposeg=45 and fechaaviso BETWEEN '2022-05-02 00:00:00' AND '2022-06-01 23:59:59' group by keyofe[finid]) where AND ofertas.keyagente in(2) [inicioid]select keyofe from seguimiento where keytiposeg=45 and fechaaviso BETWEEN '2022-05-02 00:00:00' AND '2022-06-01 23:59:59' group by keyofe[finid] where asdfas dfsa
I want to capture "where", but only if aren't contained into the text [inicioid] and [finid] of the example
I know how to exlude patter contained into a character, but not if is contained into a word
I tried with this, but only capture "wheres" are behind
(?<!\[inicioid\].+(?!\[finid\]))where
Thank you, and sorry for my english