Regular expression calculation.

Last Reply on Apr 17, 2012 04:07 AM By Mudassar

Posted on Apr 17, 2012 03:31 AM

Hi

I need a code to evaluate the regular expression without using any build in function.

If i enter the following "2*5*(2+5)" in the text box, it should automatically evaluate and display the result in the other text box.

 

Thanks in advance.

Posted on Apr 17, 2012 03:32 AM

Your question is not clear. Regular expression are meant for matching patters and not calculations. Explain clearly what you need


Posted on Apr 17, 2012 03:46 AM

Oh sorry for that.

I need to calculate the expression that is given in the text box.

If i enter "2+(2*10)", it should calculate the following expression and display the result.

I can give any expression even invalid expression such as "2*+4+(1+2".

If the given ecpression is invalid then it should display it is invalid.

Hope you understand my question.

If not please let me know.