I have a list of strings and I want to remove each string from the list that matches any of the regex patterns from another list. I have solved it this way, however, I know there is a better way to do so. For example:
Regex_list := ["^reg\ex1", "/^\d+$/", "^Apple"]
String_list := ["Apple", "Banana", "Pair" "12345"]
Want - {Banana, Pair}
I don't know my regex, but for this example lets say Apple and 12345 match the last 2 on the regex list. I want to have a list only containing Banana and Pair.
My take:
string_list := input.string_list[_]
match := {x | x := string_list; regex.match(data.regex_list[_], x)} --> {Apple, 12345}
dont_match := string_list - match --> {"Banana", "Pair"}