listA = ['Leonardo_da_Vinci', 'Napoleon', 'Cao_Cao', 'Elton_John']
listB = ['123_Leonardo_da_Vinci_abc.csv', '456_Cao_Cao_def.csv']
listC = ['Napoleon', 'Elton_John']
I would like to check if the items in listB
contain the values in listA
, and returns listC
(i.e. the list that is missing in listB
). For this purpose I would like to use regex (and no other heuristics) like (example of checking Leonardo_da_Vinci
): .*Leonardo_da_Vinci.*
The reason for regex is that the example above is just the simplest mockup and the data I use is much bigger. It is also good to have a generalised code which works on another data in future.