REGEX_Match Function Not Working?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
- Data Investigation
- Output
- Tips and Tricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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}")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Agreed with @Robin_McIntosh!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Makes sense @mkeiffer!
![](/skins/images/03E14B015E5210679CFB65D9FFC7B381/responsive_peak/images/icon_anonymous_message.png)