Page 1 of 1

arithmetic operations

Posted: Wed Mar 25, 2009 4:10 am
by bogha
hi

is it possible to use the regex to check values depending on some conditional and arithmetic operation
for example
i have 7 digit number and i want to do the follwoing

if ( A==B && B==C && C==D) // DO SOMETHING
IF(A==(B+1) && B==(C+1)) // DO SOMETHING
// A , B ,C,D are elements in an array
i want this to be done using the regular expression

best regards

Re: arithmetic operations

Posted: Wed Mar 25, 2009 4:20 am
by prometheuzz
bogha wrote:hi

is it possible to use the regex to check values depending on some conditional and arithmetic operation
for example
i have 7 digit number and i want to do the follwoing

if ( A==B && B==C && C==D) // DO SOMETHING
IF(A==(B+1) && B==(C+1)) // DO SOMETHING
// A , B ,C,D are elements in an array
i want this to be done using the regular expression

best regards
Well, that's an easy one to answer: no, that's not possible.

You will need an expression parser for that (or a scripting language capable of parsing such expressions).

Good luck.