I'm trying to write regular expression which ensure that mathematical equation syntax is true I tried many times but I didn't get what I want.
I need your help to find a regular expression to handle the following cases:
op1 = op2 [+-*/%^] number or op3*
allow nesting brackets
op1 = (op2 [+-*/%^] ( op3 [+-*/%^] op4 ) ) [+-*/%^] op5 or number*
And also allow merge of both Expressions and allow spaces between operands and operations