Alteryx Designer Desktop Discussions

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

RegEX filter

BautistaC888
8 - Asteroid

Hello,
I need to filter the rows with the words "HP" in any position. I tried to do it with a RegEX but i can't find the correct expression.

BautistaCaparelli_0-1612814529778.png

I will appreciate your help.
Thank you.

2 REPLIES 2
AngelosPachis
16 - Nebula

Hi @BautistaC888 

 

A not do sophisticated regex would be to look for "HP" with everything that may come before it or after it.

 

AngelosPachis_0-1612815263168.png

 

REGEX_Match([Nombre], ".*?HP.*?")

 

Not perfect, but it works for the given dataset

 

Hope that helps.

 

Cheers,

 

Angelos

 

 

jdunkerley79
ACE Emeritus
ACE Emeritus

A couple of suggestions:

 

Easiest is just a contains function:

CONTAINS([Nombre], "HP")

 

If you want to only match words of HP (rather than contains), something like: should work

REGEX_Match([Nombre], ".*\bHP\b.*")

 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels