I want to extend the question asked here
The solutions in the above question return True or False. And the boolean values can be used to subset the right values.
However, I want to get the search value that matched a substring.
For example,(borrowing from the above question)
s = pd.Series(['cat','hat','dog','fog','pet'])
searchfor = ['og', 'at']
I want to know that 'cat' matched with 'at' and dog matched with 'og'