I have two lists: A and B. List lengths are not the same and they both contain strings. What is the best way to match substrings in both the lists?
list_A = ['hello','there','you','are']
list_B = ['say_hellaa','therefore','foursquare']
I would like a list of matching substrings called list_C which contains:
list_C = ['hell','there','are']
I came across this answer, but it requires me to have a list of matching substrings. Is there a way I can get what I want without manually creating a list of matching substrings?
This also does not help me cause the second list contains substrings.