Regular Expression for Algebraic Expressions

Viewed 17

photo 1

photo 2

Does anyone know how to add nested algebraic expressions to a regular expression?

I will add a photo at the bottom to show my attempt at the problem, however, my attempt doesn't allow for matching opening and closing parenthesis or nested algebraic expressions such as ((a-(b+c))x2)

Any attempt or advice would be greatly appreciated. Thank you.

photo 3

0 Answers
Related