I am trying to use the value.findall()
function in OpenRefine 3.4 by finding all the rows in a column that contain specific strings i.e., "WASHER
", "FLAT
", "10MM
" and "SS
"` in any random order given and return that into a new column. Here is a snippet of my codes.
import re
regex=r"(\WASHER)(\"FLAT")(\"10MM")(\"SS")"
return re.findall(regex, value)
Here is what am what screen looks like.
You need to put the following code into the box:
This will return a whole string that contains
WASHER
,FLAT
,10MM
andSS
as whole words anywhere in the string.See the regex demo.
If they occur in immediate succession, you can use
See this regex demo.