Using RegEx on Alteryx

A regular expression (regex) is a string that is used for describing patterns. These can be very helpful for analyzing text data or extracting the data that you need from text.

The regex tool on Alteryx has four different types of functions which include, replace, tokenize, match, and parse. The pattern chosen through a regular expression helps determine what exactly these tools do in specific situations.

  • Replace: This lets you use a regular expression to replace a string or parts of a string with something else. The parts of the string that match the regex will be replaced while the rest will stay the same.
  • Tokenize: Here we can take a part of a string and extract it. On Alteryx this means that it will take whichever parts of the string that matches the regex and outputs it into different columns.
  • Parse: This can seem similar to Tokenize but it can be more helpful when you want to separate the original string into parts that are difficult to write in a single expression. By writing out the structure of the string into an expression, you can then group the string into different parts based on that structure and output them into different columns.
  • Match: Unlike the other tools, this tool will return a Boolean based on whether or not the string inputted matches the expression.

These tools can be very versatile and allows us to a lot more freedom to split and clean data than the data cleansing or text to columns tools.

Now that we understand what we can use regex for on Alteryx, lets look at how to write these expressions.

These symbols each have a specific function within a regular expression. We use them combined with other characters to create one.

For example, if we want a regex that matches the pattern of a person's title, first name, and last name e.g Mr. John Doe, the format would be: \w\w\.\s\w+\s\w+. To understand what this means we can translate this expression into English where it simply means: A word character, followed by another word character, a period, a space, one or more word characters, a space, and one or more word characters. There are numerous ways to write an equivalent expression, and deciding which kind you want will depend on how specific you want the regex to be.

Author:
Sakif Chowdhury
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab