Created
July 2, 2020 11:52
-
-
Save Per48edjes/3683bbb3e485f9723a58051af100e59a to your computer and use it in GitHub Desktop.
Multiple substring search among list of strings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def substring_list_match(string_list, substr_list): | |
return [target_str for target_str in string_list if any(search_str in target_str for search_str in substr_list)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment