The Basics of RegEx

Regular Expressions are very versatile and give you a lot of power when it comes to working with string data types. Another really great point about RegEx is that it is universal, Therefore it can be used in Tableau, Alteryx, PowerBI, SQL, etc.

When looking at RegEx we can separate functions into 2 groups; Qualifiers (What) and Quantifiers (How much).

RegEx Qualifier Functions

Above are the Qualifier functions for RegEx, We can see for example that if we want to include a new space we can use \s. Below is a screenshot showing that only the spaces are picked up.

screenshot from regex101.com - A great place to practice your regex

If we now think about only picking up all the letters that are between a and o, We can use the following expression.

Quantifiers in RegEx are used to show how much we want to be picked up by our RegEx.

RegEx Quantifier Functions

Therefore if we want to only retrieve the word RegEX from the string we do the following example.

Author:
Alexander Wood
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
© 2024 The Information Lab