import re def correct_word(string): return bool(re.match('^\w+$', string))