Alteryx designer Discussions

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

[Urgent help] Regex parsing

Highlighted
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!

 

Highlighted
13 - Pulsar
13 - Pulsar

@hungdm  Give this workflow a try.

 

Highlighted
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.

Highlighted
Alteryx Partner

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

 

Highlighted
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
Highlighted
8 - Asteroid

It worked! thanks a lot!

Labels