We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Regex to seperate last group of 3 numbers from text when text ends with a number

hellyars
13 - Pulsar

I need some help with regex.   My start field is RAW.  I can use regex to extract Line, Text and Amounts.  Note Amounts equals the last three groups of numbers,

My current regex is (^\d+)\s(\D.*?)\s(\d+.*$).  I also tried a reverse text on RAW to address some other issues.  I then split Amounts using Split to Columns using \s.

 

PROBLEM

My regex Does Not Work for record #1 below when the Text field ends with a number.

 

 

RecordIDRAWLineTextAmounts
1136 Indirect Fire Protection Capability Inc 2—Block 1 233512 162781 -70731136Indirect Fire Protection Capability Inc 2—Block 1233512 162781 -70731
2137 Ground Robotics 18241 16360 -1881137Ground Robotics18241 16360 -1881
3183 Army Direct Report Headquarters—R&D—MHA 52108 49108 -3000183Army Direct Report Headquarters—R&D—MHA52108 49108 -3000
4199 This is a more typical example 20000 30000 10000199This is a more typical example20000 30000 10000
2 REPLIES 2
DawnDuong
13 - Pulsar
13 - Pulsar

hi @hellyars 

Probably something like this - but there can be many other ways too.

Cheers,

Regex Example.PNG

atcodedog05
22 - Nova
22 - Nova

Hi @hellyars 

 

Here is my take similar to above with minor change which is highlighted which can accommodate space or hyphen or anything between numbers.

 

Workflow:

atcodedog05_0-1634745812117.png

 

Hope this helps : )

Labels
Top Solution Authors