Last active
December 29, 2015 05:29
-
-
Save zed/7622403 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env python | |
| """Print words containing the same letter at least three times in a row. | |
| http://stackoverflow.com/questions/20170022/elongated-word-check-in-sentence | |
| """ | |
| import re | |
| words = open('/usr/share/dict/words') | |
| #NOTE: support only ascii letters | |
| elongated = re.compile(r'(?i)([a-z])\1{2,}').search | |
| print("".join(filter(elongated, words))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment