Alteryx Designer Desktop Discussions

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

Regex Match and trim if a record ends with certain numbers

D_Y
8 - Asteroid

Hi 

 

I have a list of records that look like this:

Alpha

2 Bravo

18 Charlie 34

Delta12

1 Echo1

Foxtrot8

 

I am trying to use the Regex_Match function to identify records where the last OR second character is a 1. In this case, Delta12 and 1 Echo1.

Afterwards, I need to remove any character including and after that 1, i.e. return Delta and 1 Echo. 

 

How would I build this out?

 

Thanks in advance! 

2 REPLIES 2
dYoast
11 - Bolide

Try this.

dYoast_0-1660939211078.png

 

First RegEx:

Formula is:  .*1{1,}\d?

dYoast_1-1660939238338.png

 

Second RegEx:

Formula is:  (.*)1{1,}\d?

dYoast_2-1660939271314.png

 

End Result:

dYoast_3-1660939357005.png

 

D_Y
8 - Asteroid

Thank you!

Labels