Hello!
I'm trying to resolve the following case:
I have to find a match in a list and the example is:
List of words:
------------------
PEPPERCORN
CORN MEAL
CORN OIL
CORN
The pattern match word is "CORN" so my result should return CORN MEAL, CORN OIL, CORN but NOT PEPPERCORN.
I built a sample workflow that uses both REGEX tool and a formula that uses REGEX_Match. REGEX tool returns correct results but I am not sure how to pass a dynamic string there instead of hard coding my pattern.
REGEX_Match does not match CORN MEAL, CORN OIL. It matches CORN with CORN only. How can I make this function work for
CORN MEAL, CORN OIL (but not PEPPERCORN)?
I'm more leaning towards using REGEX_Match solution.
I'm attaching my workflow.
Thanks in advance!
K.
Solved! Go to Solution.
Hi @Saumil!
Sorry for the slow response. I was on vacation. Here's one approach:
Let us know if this works for you.
Maybe you can try a formula tool:
If Regex_Match([Original field], ".*CORN.*") then [Original field] else null() endif
or
If contains([Original field], "Corn", 1) then [Original field] else null() endif
the "1" is to ignore case, use "0" if you want case-sensitive test.