arithmetic operations

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
bogha
Forum Newbie
Posts: 8
Joined: Tue Aug 05, 2008 2:06 am

arithmetic operations

Post 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
User avatar
prometheuzz
Forum Regular
Posts: 779
Joined: Fri Apr 04, 2008 5:51 am

Re: arithmetic operations

Post 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.
Post Reply