import re word="하하하" reg = re.compile(r'[가-힣a-zA-Z]') if reg.match(word): print("It is an alphabet") else: print("It is not an alphabet")