I have to tokenize a conditional string expression :
Aritmetic operators are = +, -, *, /, %
Boolean operators are = &&, ||
Conditional Operators are = ==, >=, >, <, <=, <,!=
An example expression is = (x+3>5*y)&&(z>=3 || k!=x)
What i want is tokenize this string = operators + operands.
Because of ">" and ">=" and "=" and "!=" [ which contains same string] i have problems with tokenizing.
PS1: I do not want to make complex lexial analysis. Just simply parse if possible with reqular expressions.
PS2: Or in other words, i look for a regular expression which is given sample expression wihout whitespace =
(x+3>5*y)&&(z>=3 || k!=x)
and will produce each token is separated with a white space like :
( x + 3 > 5 * y ) && ( z >= 3 || k != x )