0

Im trying to make regex for Math terms. The rules are at beginning very simple: no variables, and operators are + -. Something I come up with was :

^[(]*-?\d+(\.\d+)*([+-]{1})*(([(]*-?\d+(\.\d+)*([+-]{1})*[(]*(-?\d+(\.\d+)*([+-]{1})*[)]*)*)*([+-]{1})*)*[+-]{1}-?\d+(\.\d+)*[)]*

Functioned for complicated terms but for those not complicated not. Any advice ?

Ole V.V.
  • 65,573
  • 11
  • 96
  • 117

0 Answers0