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_Replace

irybchuk
5 - Atom

Hi All,

I need to parse the second half of the text from string records. The string's structure is as following: [Question Group] [Question ID] [Question Name], for example: "COVID PREVENTION 01 Does Management Plan (OP9) has...

 

I have highlighted the part I need to extract from the string.

 

I am trying to use the REGEX_Replace formula to achieve this; please see below:

REGEX_Replace([Name],".*?(\d{1,2})", "$1")

 

For most of the records, it is working correctly. However, when there are any following digits in the string, it parses at the last digit occasion, not the first one. Could you please suggest how the formula should look like?

 

I appreciate any help you can provide.

1 REPLY 1
MarqueeCrew
20 - Arcturus
20 - Arcturus

@irybchuk ,

 

 please try:

 

Regex_Replace([Name],"(.*?)(\d{2,3}\s.*)",'$2')

 

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels
Top Solution Authors