Hi,
I have a zipcode field in a dataset and which might not include digits and have state codes. I need to check to see if it contains numbers or not and filter out the records that doesn't contain digits. I tried regex but didn't get the expected output and getting some data type mismatch error. Looking for some help. Thanks in advance!
Solved! Go to Solution.
REGEX_Match([Field], '[0-9]{5}')
That formula will check to see if there are 5 digits in a row within a the field, you can use it inside a filter tool. Without more details around your data examples it will be challenging to diagnose further.
@dsandmann Thanks for the inputs. I already tried this and also the same formula with 'd' instead of 0-9 but the problem is I'm getting data type error "tried to apply string operator to numeric value" even after using select tool to change data type to double
So regular expressions is functioning with assumption that it is a string data type not a number. The fact that you changed it to a double is causing that error and it is telling you it cannot run a regular expression on a double
In addition I find the following website very helpful when testing out different regular expressions:
Hi
Do you have any sample input with expected output.
for Regex formula to work we need to understand the logic for the data
@binuacs Got busy with something and got back on this today and it worked:) Thank you so much!
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |