I need a help in writing a validator in javascript or JQuery for a string expression that will allow arithmetic expressions like (),+,-,*,/,min(),max(),avg().
In the string, min(),max(),avg() should allow only two arguments.
Sample string expression to validate :
(x+y+max(min(x,y),z)+avg(x,y)*z/y)
What I have tried:
First I have tried a syntax parser and trying to tokenize the strings and validate individually but didn't work. Is there any way to do it?