Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Regex Help

cchannyyy
5 - Atom
Hi Community,
 
I'm trying to use Regex to grab the third to last entity "P1DX68N". What would be the regex formula?
 
This is the following placement:
 
AFR_2020_aw_US_CADREON_pmp_PKG_crossdev_multi_rot_na_Audio Package_audio_audio_NA_NA_nonskip_CPM_SS_EN_C20AFR00US_P1DX68N_9/17/2020_11/1/2020
 
Best,
3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @cchannyyy ,

 

You extract that by using this formula in formula tool

 

Right(left([Field1],Length([Field1])-20), 7)

 

Output:

atcodedog05_0-1602003421723.png

Workflow:

atcodedog05_1-1602003441094.png

 

Hope this helps 🙂

 

If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

 

jdunkerley79
ACE Emeritus
ACE Emeritus

Hi,

 

I suggest:

REGEX_Replace([Field1], "^.*_([^_]+)_[^_]*_[^_]*$","$1")

This will pick the 3rd from the last block surrounded by '_' 

 

Quick sample attached.

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @cchannyyy 

 

Cheers and happy analyzing 😀

Labels
Top Solution Authors