Skip to content

Instantly share code, notes, and snippets.

@shivamMg
Last active August 29, 2015 14:26
Show Gist options
  • Save shivamMg/769fffed676e4d1f5960 to your computer and use it in GitHub Desktop.
Save shivamMg/769fffed676e4d1f5960 to your computer and use it in GitHub Desktop.
import re
if __name__ == '__main__':
regex = re.compile(r'^([asdfgqwertzxcv]*|[hjklyuiopbnm]*)$')
with open('words.txt', 'r') as fptr:
for word in fptr:
if regex.match(word):
meat = regex.match(word).group(1)
print(meat)
# To print words with length greater than 7:
# if len(meat) > 7: print(meat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment