def METHOD_NAME(token):
    # Remove quotes
    value = token.value[1:-1]
    if len(value) > 64:
        raise ValueError(f"String literals must be 64 characters or less: {value}")
    if not SAFE_CHARS_RE.match(value) and not value == "":
        raise ValueError(
            f"String literals can only contain alphanumeric characters, "
            f"underscore and the comparators '<', '>', '=', and '~': {value}"
        )
    return sqlparse.sql.Token(ttypes.Literal.String.Single, f"'{value}'")