Last active
July 3, 2020 14:32
-
-
Save dardanxhymshiti/c6f4e5e63d24f5b5d4a84e2e703d0845 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_capital_words(text): | |
import re | |
pattern = r'(\b[A-Z]{2,}\b)' | |
list_of_capital_words = re.findall(pattern, text) | |
return list_of_capital_words; | |
# Test | |
text = """Thank you! Your customer service request has been logged. A specialist will reach out by EOD""" | |
get_capital_words(text) | |
# ['EOD'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment