I am trying to look for a keyword in a sentence and return the whole word. For example my keyword is 'str' and if there's match for 'str' in all_text, I want to return 'string' .
all_text = 'some rather long string'
keyword_list = ['str', 'rat', 'me', 'ng']
for item in keyword_list:
if item in all_text:
print(item)
str
rat
me
ng
Instead of str, rat, me , ng I want to return string, rather, some, long.