i must use regex for part of my project. I want to seperate for AND,OR operators from given inputs. But i don't need operators which are situated in parentheses.
Example input : C1 OR [C2 AND C3] AND C4 OR C5 AND [C6 AND C7 OR C8 ] OR C9
Output : OR AND OR AND OR
Other Example input : C1 AND C2 AND [C3 OR C4] AND C5
Output : AND AND AND