Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

RegEx - Tokenize

SylviaK
8 - Asteroid

Hi, 

 

Gradually getting familiar with the RegEx tool but not quite there yet. I have attached an excerpt of the data showing the input and the output that I want. 

 

I used the following as a regex expression: 

 

\u{2}\s\d.*\>\u{2}\s.*\-\s\(d.*) and then tokenize into rows

 

But got the Reg EX Mismatched brackets exception, not sure why though. Can someone pls help?

 

Many thanks

Sylvia

 

13 REPLIES 13
SylviaK
8 - Asteroid

@vizAlter No - not really. Have made it more clearer in the attachment. many thanks

Maskell_Rascal
13 - Pulsar

Hi @SylviaK 

 

I think this is what you're looking for. I'm not super well versed in RegEx, but was able to get to your desired output combining a couple different tools. 

 

Maskell_Rascal_0-1598381472487.png

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Thanks!

Phil

SylviaK
8 - Asteroid

@Maskell_Rascal 

 

Brilliant. It does work. Can you pls explain this expresison though? I get .*, but not the brackets and the bits in the bracket. many thanks

 

(?<=>).*

Maskell_Rascal
13 - Pulsar

 Hey @SylviaK 

 

Glad it worked for you! It breaks down as follows:

 

?= Positive Look Ahead

.* Matches any character (except newline)

() Groups

 

So ?= is used to identify ">", but we don't want to select ">". So I'm using a ?<= to find ">", but not select it while still looking forward. 

 

I hope that makes sense. 

 

Thanks!

Phil

Labels
Top Solution Authors