I am working on a JavaScript application that needs to validate mathematical expressions and I am not sure how to do this.
My syntax example is
(keyword1 + keyword2) * (keyword1 / (keyword1 + keyword1))
Here, keyword1 and keyword2 can be any numbers, and valid operators are standard addition, subtraction, multiplication, and division.
Does anyone have any ideas how to do this, possibly using regular expressions?
Simple soultion is we can sent the ajax request to the server may be database with expression if it return the correct value without error my expression is valid else not valid
simple ha~