I am building an application where the user can specify an expression for some fields. The expression shall contain functions too. I need to evaluate these expressions and display final value in report.
I had an expression to extract function-name & it's paramters. Previously, the function parameters were decimal values. But now, the parameters can also be expression.
For ex,
Round( 1 * (1+ 1 /100) % (2 -1), 0)
Function-name : Round
Parameter1 : 1 * (1+ 1 /100) % (2 -1)
Parameter2 : 0
Previous Regex:
string pattern2 = @"([a-zA-Z]{1,})[[:blank:]]{0,}\(([^\(\)]{0,})\)";
This regex does not help me anymore to find expression-parameters.
Can someone help me with the right regex to extract function-name & parameters? I am implement all or most of the functions supported by Math class. The program is built in c#
Thanks in advance for the help.