Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Regex Match

garaya
7 - Meteor

Hi,

 

I'm trying to match to a simple character set. I've tried to use the Regex tool and the Regex function in the formula tool with no luck. I guess the expression is fine because it works with the Regex replace feature but not with the Match, Ionly get "False" results. Anyway, if anybody can help me with this, I'll really appreciate it.

 

5 REPLIES 5
patrick_mcauliffe
14 - Magnetar
14 - Magnetar

@garaya the Regex isn't matching because there are more than just the specified characters in the string.
If I'm understanding the use case correctly, you'll want to match on this:
.*[.,:;].*

danilang
19 - Altair
19 - Altair

Hi @garaya 

 

This is interesting because you're the second person today with this issue.  See this post

 

Regex_match has to match the entire field to return true.  Use .*[.,:;].* as your criteria

 

Dan

Thableaus
17 - Castor
17 - Castor

Hi @garaya 

 

The REGEX_Match function demands a full match.


That means your expression should match and cover all characters.

For example, in your case you could adapt to something like this:

 

(.*)([.,:;])+

 

This means match any character 0 or more times and then any of these characters ([.,:;]) 1 or more times.

 

Cheers,

garaya
7 - Meteor

Hi @danilang 

 

Thanks for sharing this, I'm new on this but as you mentioned in that post, there's a difference on how the replace and match works. Definitely I need to study more about the regular expression syntax.

 

Thanks!

garaya
7 - Meteor

Hi @Thableaus 

 

This works perfect! Thanks a lot!

 

Regards!

Labels