Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Don't Parse if digit is a specific number

arianner
6 - Meteoroid

Hello,

 

I'm looking to parse a 6 digit number that starts with 2 and ends with 4, but if the second to last digit is a 1 or a 2 then I don't want it to be picked up and parsed. 

Right now my expression is: (2\d\d\d\d4)

 

For example if this is the data:

SO234574

Q289724

ASDI200094

 

I don't want it to pick up the blue line

 

Is there a way to do that?

5 REPLIES 5
ShankerV
17 - Castor

Hi @arianner 

 

Please use the below.

 

(2\d\d\d[0-03-9]4)

 

ShankerV_0-1680023507177.png

 

Many thanks

Shanker V

arianner
6 - Meteoroid

that worked! thank you so much!

Can you please explain what this section means? [0-03-9]

ShankerV
17 - Castor

Hi @arianner 

 

Whenever you use open and close bracket with the values inside it, it will look for only those values.

Usually we will use [0-9] to read all the number.

 

As your requirement was different where, no 1 or 2 should be read.

Framed the expression as [0-03-9] to eliminate 1 and 2 in-between.

 

Hope it helps!!!

 

Many thanks

Shanker V

 

 

arianner
6 - Meteoroid

I was viewing this 0 as extra  [0-03-9] but I see.

thank you!

ShankerV
17 - Castor

Hi @arianner 

 

Yes, we can use like this too. (2\d\d\d[03-9]4)

Just wanted to have some order while building expression, where I followed ranges format from my perspective.

 

(2\d\d\d[03-9]4)

(2\d\d\d[0-03-9]4)

 

Both the above will fetch the same result.

 

Many thanks

Shanker V

 

 

Labels