Calling all Racers for the Alteryx Grand Prix! It's time to rev your engines and race to the stage at Inspire! Sign up here.

Alteryx Designer Discussions

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

Regex Parse

8 - Asteroid



I am trying to regex parse dynamically.


I.e. my data is 2020 2021 Total


I want to pass it through the regex parse to split out the data into columns, one for each of 2020, 2021 and Total and then rename the columns dynamically. 


My issue is that sometimes the data can be '2021 Total' instead and so I need the second regex parse tool in the attached workflow. However when I add this, the expression is not correct as it also parses the data that is "2020 2021 Total". Instead what I want is for the data to be returned as Null because it has 2 sets of numbers in.


Any help on this one would be much appreciated?

14 - Magnetar

Use a website like to test out your regular expression.






will match 2021 Total

but will not match 2020 2021 Total



will do the reverse



13 - Pulsar

Instead of RegEx, could you use a Text to Columns tool?  Change the delimiter to a space and it will parse either "2020 2021 Total" or "2021 Total".  You can then rename them, and remove the null column for "2021 Total".