I have a regex that I use to match Expression of the form (val1 operator val2)
This regex looks like :
(\\(\\s*([a-zA-Z]+[0-9]*|[0-9]+|\
What language/application are you using this regular expression in? If you have the option you can specify the different parts as named variables and then build the final regular expression by combining them.
val = "([a-zA-Z]+[0-9]*|[0-9]+|\'.*\'|\[.*\])"
op = "(ni|in|\*|\/|\+|\-|==|!=|>|>=|<|<=)"
exp = "(\(" .. val .. "\s*" .. op .. "\s*" .. val .. "\))"