I'm going to validate simple math expressions such these:
a = 1 + 2
b = 2.2
a = b + 5.5
a = b - -5.5
a = -1 + 2
a = -2.4
a = 3.5 / 0.2 + 1
a = 3 * -2.1
NOTE: Operator precedence is not important!
I try following expressions but i got nothing!!!
for digits: ^([-]|[.]|[-.]|[0-9])[0-9]*[.]*[0-9]+$
for operators: [-]|[+]|[*]|[/]
for variables: [a-z]+|[A-Z]+
I put these expressions in C# string variables and used .net Regex.Matches(...)
to find matches. But i got nothing!