s = '>50&<100'
s2 = '>30'
s3 = '<30'
s4 = '=10'
s5 = '!=10'
s6 = '>2|<5'
so my strings should be:
comparison operator ( < > = != ) followed by an integer value -> we call it EXPRESSION
optional logical operator ( | & ) followed by an EXPRESSION
What's the best way to:
a. validate the input string b parse it so I can create the expression in valid python
P.S I can thing of a regex solution. I was thinking something like creating a grammar and parse it to a tree.