Original list: He_is_super_hero_Spiderman He_was_a_super_actor_Tom This_line_is_not_supposed_to_match Finding whole lines containing matches: He_is_super_hero_Spiderman He_was_a_super_actor_Tom Finding and extracting matches: Spiderman Tom Not actually looking for matches, just extracting the last word: Spiderman Tom match