How to parse – regular expressions…
===

(Age > 16) AND (Age < 50)  ==> (C1) AND (C2) 

(Age > 16) AND ((Age < 50) OR (GENDER= ‘F’))  ==> (C1) AND ((C2) OR (C3))

All the operands  are defined in a database table. So I know what operand to expect. Comparison operator is also known. How to parse these kind of equations in T SQL? I just want to convert them to C1, C2 etc tokens and store these values in a table as Condition(C1,C2,C3 etc), Operands (Age, Gender) and operator(>, < =) and its values(16, 50 etc)?

Is regular expressions is helpful here? Is there any alternate solution?

Thank you,
Smith

