I’m trying to filter a table if any record in a column includes: “CTO” or “Chief Technology Officer”. I don’t need it to be case sensitive. “A CTO at Coca-Cola” should match but not “A CTIO at Coca-Cola”
The following doesn’t seem to work:
\b(?:CTO|Chief\stechnology\sofficer)\b
Is there another recommended way than regex for this?
There is a joke that goes “If you have a problem and the solution is Regex, now you have two problems.”
Personally, I won’t go the regex route. I will simply convert the case of the column with the roles to lowercase, then use a rule-based role filter to isolate the rows which include “cto” or “chief technology officer”. You can also use uppercase, but the case in your strings and the configuration of the rule has to match.
Here is the rule I created in the rule-based row filter node:
$role lowercase$ LIKE “cto” OR $role lowercase$ LIKE “chief technology officer” => TRUE
You can discard the lower case column with the column filter node.
To add, if you want to check if a records contains cto and other terms, you need to use wildcards in the LIKE statement, otherwise it will only filter literal matches.
$column1$ LIKE "*cto*" OR $column1$ LIKE "*chief technology officer*" => TRUE