I am trying to validate a string which can contain some conditions and logical operators. For example, My input expression could be something like this:
(var1==var2 AND var2==var4) OR (someothervar!=5) AND (somemorevar=<4 OR var5<10)
Later, I would be converting this string to a java readable expression,
(var1==var2 && var2==var4) || (someothervar!=5) && (somemorevar=<4 || var5<10)
The input string is captured at runtime, and it can be anything. My concern is to validate the input string to be a valid expression, so later only AND and OR could be replaced with && and || to evaluate.