Last active
July 3, 2020 14:32
-
-
Save dardanxhymshiti/7f64e68e9492861eebc15adc6a78c545 to your computer and use it in GitHub Desktop.
This file contains 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 get_text_within_quotes(text): | |
import re | |
pattern = "\"(.*?)\"" | |
list_of_findings = re.findall(pattern, text) | |
return list_of_findings | |
# Test | |
text = """The sign said, "Walk". Then it said, "Don't Walk" then, "Walk" all within thirty seconds""" | |
get_text_within_quotes(text) | |
# ['Walk', "Don't Walk", 'Walk'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment