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

Help in Regex Expression

James89
7 - Meteor

Hi,

 

I am trying to split a string with the following format into 8 separate columns.

 

TEAM||Manchester|London||City|Derby|Number of Players|Man of the Match|Match Day

 

I have tried using Regex expression ([^|]*) as suggested doesn't work out that way. Any tips that could help solve this issue?

 

Thanks!

4 REPLIES 4
Deano478
12 - Quasar

hey @James89 this could be neater but this will do it for you

([^|]+)\|\|([^|]+)\|([^|]+)\|\|([^|]+)\|([^|]+)\|([^|]+)\|([^|]+)\|([^|]+)

 

 

OTrieger
14 - Magnetar

@James89 
It can be done also with the use of Text To Column tool, Using Pipe as the delimiter.

DataNath
17 - Castor
17 - Castor

Hey @James89, the following ought to work in the RegEx tool in Tokenize mode, splitting to 8 fields:

 

([^|]+)\|?
James89
7 - Meteor

Thanks @DataNath ! It really works.

Labels
Top Solution Authors