Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

[Urgent help] Regex parsing

hungdm
8 - Asteroid

<ctC13>00a01-2019</ctC13>

 

I wanna extract the string above into 3 fields (only using RegEx):

Case 1:

 

ctC13

00a01-2019

/ctC13

 

OR

Case 2:

 

C13

00a01-2019

C13

 

 

Have tried several ways but it didn't work out:

case 1:

 

\<(.*?)\>(.*?)\<(.*?)\>

 

case 2: 

\<ct(.*?)\>(.*?)\<\\ct(.*?)\>

 

 

Could anyone help me? Thanks!

 

5 REPLIES 5
patrick_mcauliffe
14 - Magnetar
14 - Magnetar

@hungdm  Give this workflow a try.

 

hungdm
8 - Asteroid

Thanks!

I have a large number of records having the same structure. hence this one is actually not very performance-efficient to my specific case.

DiegoParker
10 - Fireball

Hi @hungdm 

 

You have to use <(.*?)>(.*?)<\/(.*?)>

DiegoParker_0-1583325415443.png

 

The reason is because whilst usually we would escape a character using "\" in this case \< represent beginning of word.

 

Hope this helps If does, can I ask you to mark it as a solution? this will help other users to find it and will allow us to close the thread. Many thanks!

 

EDIT: If you want to keep the "/" at the end of the third field, then just do <(.*?)>(.*?)<(.*?)>


Best,
Diego

 

VianneyM
Alteryx
Alteryx

Hi, 

using the information given by @DiegoParker  I added the second case

 

VianneyM_0-1583334073730.png

 

I hope is helpful

 

Best,

Vianney

 

Best,
Vianney
hungdm
8 - Asteroid

It worked! thanks a lot!

Labels