def isSafeLiteral(x: str) -> bool: m: Match = re.match("^\w+$", x) m2: Match = re.match("^[^\d]", x) return m is not None and m2 is not None