I'm new to RegEx and this is driving me crazy.
I'm trying to find non-numeric characters in a data field that should be numeric.
In this case one of my users entered '< 85' in their spreadsheet.
I've set up a RegEx Parse to look for \D+, which to my understanding should match any field that contains one or more non-digits. My output method is Match, but this expression is not matching the '< 85'.
I tested it on https://regex101.com/ and it matches in their tester, so I'm not sure what's going on here.
Tiny example workflow attached.
Thank you!
Solved! Go to Solution.
random guess, but it could be the space. I'm not sure how non-digit accounts for spaces.
Hi @jlefeaux
Match mode on RegEX checks the whole string for a match.
So basically, \D+ is checking if the whole string is a non-digit expression.
Cheers,
Try ^\d*\D+\d*
Can your numbers be decimals? If so, you have to consider the (.) as a character as well.
Cheers,
Hi @Thableaus. Thanks for your suggestion, but sadly it did not work.
I've extended the sample workflow to include 2 bad examples and ^\d*\D+\d* did not catch either of them.
It's a good point about the decimal place & I will definitely address that once I get this issue figured out.
You're adding an extra whitespace after the expression "^\d*\D+\d*"
Take off the extra whitespace at the end of the RegEX and it'll work.
Cheers,
To match cases like <85+81 - let's say, non-digits with more digits
(^\d*\D+\d*)+ would do the trick.
Cheers,
Arrgh, the whitespace came from copying & pasting from the webpage.
Removing the whitespace worked on the sample set in my example... But your new expression did not match <85+81
I've updated the tiny workflow with '(^\d*\D+\d*)+' and '<85+81' & included it here if you are interested in pursuing the question. Regardless, I'm going to mark your previous post as the solution.
Thank you!
Sorry, it's ^(\d*\D+\d*)+
^ refers to the beginning of the line. So it happens just once.
Cheers,
Ummm, acutally, no... it didn't :D
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
6 |