Displaying page
of
pages;
Items to
Title |
Test
Details
Arithmetic expression assignment
|
Expression |
(?<id>[A-Za-z_][0-9A-Za-z_]*) (?<op>\=) (?: (?> (?: (?<= ((\.[0-9]+|[0-9]+(\.[0-9]+)?)([eE][-+][0-9]+)?|[0-9]+) | [A-Za-z_][0-9A-Za-z_]* | \) ) (?<op> \+ | \* ) ( ?= ((\.[0-9]+|[0-9]+(\.[0-9]+)?)([eE][-+][0-9]+)?|[0-9]+) | [A-Za-z_][0-9A-Za-z_]* | \( ) ) | ( ?<parenthesis> ( ?<= \= | \+ | \* | \( ) (?<op>\() ( ?= ((\.[0-9]+|[0-9]+(\.[0-9]+)?)([eE][-+][0-9]+)?|[0-9]+) | [A-Za-z_][0-9A-Za-z_]* | \( ) ) | ( ?<-parenthesis> ( ?<= ((\.[0-9]+|[0-9]+(\.[0-9]+)?)([eE][-+][0-9]+)?|[0-9]+) | [A-Za-z_][0-9A-Za-z_]* | \) ) (?<op>\)) (?! ((\.[0-9]+|[0-9]+(\.[0-9]+)?)([eE][-+][0-9]+)?|[0-9]+) | [A-Za-z_][0-9A-Za-z_]* ) ) | (?: (?<= \= | \( | \+ | \* ) (?: (?<const>(\.[0-9]+|[0-9]+(\.[0-9]+)?)([eE][-+][0-9]+)?|[0-9]+) | (?<id>[A-Za-z_][0-9A-Za-z_]*) ) ( ?=$ | \) | \+ | \* ) ) )+ ( ? ( parenthesis ) (?!) ) )$
|
Description |
I use this expression to parse assignment of arithmetic expression. Supports alphanumeric id, scientific numbers, brackets, +/* operators and assignment.
|
Matches |
COST=(PRICE+TAX)*0.98e+4+(1+2)*3|x=a*b+(c+d)*5|t=1
|
Non-Matches |
x|1|COST=(PRICE+TAX)*0.98e+4+(1+2)*
|
Author |
Rating:
Not yet rated.
Bereznikov Alexey
|
Displaying page
of
pages;
Items to