Alteryx Designer Desktop Discussions

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

RegEx Question

rrahu07
8 - Asteroid

Can someone please help me with this problem?

 

rrahu07_1-1650118199461.png

 

I am trying to create a new account number by taking first 4 and last four digit. example 14620001-4015 >>>> 14624015
61310001-4015_D >>>61314015

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus

@rrahu07 

 

Without Regex you can use a data cleanse tool and remove letters and punctuation.  Then you could get 

 

left([field],4) + right([field],4)

 

 

 cheers,

 

 mark

 

 regex_replace([field],"(\d{4}).*(\d{4})\D*",'$1$2')

 

regex101.com

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
atcodedog05
22 - Nova
22 - Nova

Hi @rrahu07 

 

I hope this is the expected output. If not please explain me your requirement so that I can help you on how you approach the usecase.

 

atcodedog05_0-1650119083753.png

 

Hope this helps : )

atcodedog05
22 - Nova
22 - Nova

Hi @rrahu07 

 

You can learn more about Regex from the below links

https://community.alteryx.com/t5/Interactive-Lessons/Parsing-Data-with-RegEx/ta-p/441415

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-RegEx/ta-p/37689

 

In addition to the above resources, you can use https://regex101.com/ as a sandbox for building and testing out regex. The tool is very intuitive for step-by-step regex building.

atcodedog05_0-1650119225908.png

 

This should help you get started with the amazing journey of Regex 🙂

 

Hope this helps : )

Labels