I am trying to parse dirty data. I have a list of names that I am feeding into Find/Replace. For instance, one of the names I'm trying to find is JOHN79.
String: JOHN 79NGSB -> FIND AND REPLACE TOOL --> Output: JOHN 79
The problem is that I need "JOHN 79" to be surrounded by spaces, (i.e., not touching anything else), so in the above example, I want nothing to be returned as output. Is there a way I could use Regex to take the Find/Replace Output and use that value to check if it has spaces on either side? If it starts at the beginning of a line or ends the line, that is ok too.
For example, the following are ok:
JOHN 79 NGSB
23983324 JOHN 79
Not Ok:
JOHN 79213
123JOHN 79
Any help would be appreciated.
Solved! Go to Solution.
In the Find & Replace tool, try checking the box for "Match Whole Word Only". I believe this will eliminate the ones that have letters/numbers adjoining the names you're trying to find.\
Hope that helps!
Cheers,
NJ
Hi @bb213,
Below is the expression I added to a RegEx tool using the Parse output method. Can use the Replace, but added to a new field for output comparison.
(?:^|\s)(JOHN 79)(?:\s|$)
Attached is the workflow as well. Hope this helps!
Best,
Jimmy