Hi community
i am trying to identify key words from a list of transaction data and have been experimenting with the regex_match function. However, i have come across an issue where the key word is picking up a wildcard of the key word contained in other words
by way of example, the regex match function uses the key word "IGA" (a local supermarket franchise) but is returning additional words that contain "IGA" such as "SPIGA" .
regex_match([vendor], ".*( IGA |Woolworths|Coles|Harris Farm|Aldi|Greenwood Grocer).*")
For example the data set could include
IGA North Sydney
IGA Lane Cove
IGA Burwood
VIA DIA SPIGA
How can i update this expression (or utilise other tools) to ensure i am only picking up transactions that contain an exact match to the key word? In the above example, i would only want IGA North Sydney, IGA Lane Cove and IGA Burwood to be identified and not "VIA DIA SPIGA"
many thanks
Solved! Go to Solution.
Hi @gavin_chin,
here is the updated RegEx, you just needed to add somethign to specify it's a word you are looking for :
regex_match([vendor], ".*(\<IGA\> |\<Woolworths\>|\<Coles\>|\<Harris Farm\>|\<Aldi\>|\<Greenwood Grocer\>).*")
Or
REGEX_Match([Field1], ".*\<(IGA|Woolworths|Coles|Harris Farm|Aldi|Greenwood Grocer)\>.*")
Thank you @Ladarthure
Your first suggestion worked to exclude the "VIA DI SPIGA" example.
However, it seems to have inadvertently excluded other genuine transactions that contained the word "IGA" - for example the results using this regex_match in a Filter tool resulted in
False: "ROMEOS FOODHALL IGA"
True "IGA COOTA" or "ROMEOS IGA OXFORD ST" were correctly picked up.
In the above, i would have expected "ROMEOS FOODHALL IGA" to also be captured as 'TRUE"
many thanks