I've a problem which puzzles me, and I can't figure it out how to do this in C#.
Let's say, I have this formula: ((true or false) and (false or true))
This is just a sample formula, but it could be much more complex like this: ((((true or ((((true or false) and (false or ((true or false) and (false or ((((true or false) and (false or ((true or false) and (false or true)))) or not ((true or false) and (false or ((true or false) and (false or true)))))))))) or not ((true or false) and (false or ((true or false) and (false or true))))))) and (false or ((true or false) and (false or ((((true or false) and (false or ((true or false) and (false or true)))) or not ((true or false) and (false or ((true or false) and (false or true)))))))))) or not ((true or false) and (false or ((true or false) and (false or true))))))
etc.
I'd like to break it into three parts
(true or false)
and
(false or true)
In an other way, I'd like to break this formula, to its two partial-formula and its operand. Right now, I have two binary operator (or,and) and one unary operator (not).
How can I solve this problem? Could you help me on this? I've tried regular expressions, with Grouping Constructs, but I'm not an expert of regular expressions.
Thanks, Otto