Parsing the Logical expression
Sometimes you need to parse the logical expression.
I have made for my own purposes the regular expression which would distringuish all important tokens from the logical expression:
this would give for
I have made for my own purposes the regular expression which would distringuish all important tokens from the logical expression:
([\(!\s]*)[\s]*([^<=\s]+)[\s]*(<>|!=|==|<=|>=|<|>)[\s]*([^\s&|\)]*)[\s]*([\)]*)(&&|\|\|)?or as java string:
"([\\(!\\s]*)[\\s]*([^<=\\s]+)[\\s]*(<>|!=|==|<=|>=|<|>)[\\s]*([^\\s&|\\)]*)[\\s]*([\\)]*)(&&|\\|\\|)?"
this would give for
!(! (one== 56) && two>45) || !three!=funnythe following solution
Comments