Alteryx Designer Desktop Discussions

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

REGEX_Match Function Not Working?

mkeiffer
9 - Comet
9 - Comet

Hi everyone,

 

I am fairly new to Alteryx and I am having an issue with the RegEx_Match function.  I have written the following filter with RegEx_Match:

 

REGEX_Match([Medical Record Number], "\b\d{3}")

 

However, I am not getting any records that match the filter, even though I can see there are several records that should match the filter.  The field type is V_String and I have double-checked the formula so I am not sure what I am doing wrong.  

 

I have used regular expressions with other programs so I am not sure what the issue.  Any help will be greatly appreciated!

 

Here is a sample of what the data looks like -

 


Medical Record Number
52184
57921
56683
49317
55947

 

Thanks in advance for your help!

 

Mike

 

7 REPLIES 7
flying008
14 - Magnetar

Hi, @mkeiffer 

 

What are you want output ? maybe you can give sample output data for the case.

alexnajm
17 - Castor
17 - Castor

What are you trying to match pattern-wise? Based on the data you posted, it seems like it should be REGEX_Match([Medical Record Number], "\d{5}")

Robin_McIntosh
11 - Bolide

@mkeiffer - Based on what you have, REGEX_Match([Medical Record Number], "\b\d{3}"), are you trying to pull out the first 3 digits?  If so, use the RegEx tool and tokenize.

Robin_McIntosh_1-1678368637096.png

 

alexnajm
17 - Castor
17 - Castor

Agreed with @Robin_McIntosh!

mkeiffer
9 - Comet
9 - Comet

@flying008 @Robin_McIntosh @alexnajm 

 

Hi everyone,

 

Thanks so much for taking the time to respond to my post.  Yes, I was trying to test for the first 3 characters of the Medical Record Number field being all numeric characters.  I was going to go to the Reg Ex tool next, but I did get the following expression to work with the RegEx_Match function, using the Filter tool.

 

Here is the expression that worked:

 

REGEX_Match([Medical Record Number], " \b\d{3}.* ")

 

Looks like I needed to end my expression with .* and then it ran correctly.

 

Thanks again to everyone for taking the time to respond to my post.  It is much appreciated!

 

Mike

 

mkeiffer
9 - Comet
9 - Comet

@alexnajm 

I did try the expression this way and that also worked.  I was also trying to see if I could get the RegEx_Match function to just identify the first 3 characters as numeric as well.  

 

I did find a way to get that approach to work with this expression:

 

REGEX_Match([Medical Record Number], "\b\d{3}.*")

 

Adding the .* at the end of the expression got it to work with focusing on the first 3 characters.

 

Thanks again for you help!

 

Mike

alexnajm
17 - Castor
17 - Castor

Makes sense @mkeiffer!

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