Alteryx Designer Desktop Discussions

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

Regex Match issue

Cela
8 - Asteroid

Hi everyone,

 

I am trying to formulate the proper expression for the following condition:

 

The cell value should consisit of the combination: 2 capital letters ([A-Z]), 9 alphanumeric values (\w) and 1 digit (\d)

An example of the allowed cell value would be 'GB1w87p30f40'.

 

I tried a few variations of the expression I thought would work but I can't seem to put it together properly.


Would appreciate it if somebody could help me out here.

Thanks in advance!

5 REPLIES 5
caltang
17 - Castor
17 - Castor

Please provide relevant data to this use case, and kindly provide your criteria in as much detail as possible. If you have a workflow built halfway, kindly export that over as well.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
FrederikE
13 - Pulsar

Hey @Cela,

 

This should work: ^[A-Z]{2}\w{9}\d$

 

Screenshot 2023-10-13 122614.png

 

FYI, ChatGPT is very good for such straight-forward Regex.

caltang
17 - Castor
17 - Castor

Nevermind... did some random data here:

image.png

 

^[A-Z]{2}\w{9}\d$
Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Cela
8 - Asteroid

@caltang Thanks for the quick response! I am basically checking the cell values of a specific column to see if the condition is met. This checkup happens in inside the Table tool by editing the column rule for the specific column. If the condition is not met, I want to turn the background color crimson, else it shall turn green.

My issue doesn't lie with the entire expression but with the format of the condition itself:

If !REGEX_Match([Field1], >MISSING EXPRESSION HERE<) then "background-color: crimson" else "background-color: green" endif

 

Hope it helps to clarify what I meant initially!

Cela
8 - Asteroid

Perfect, thanks guys!

Labels