def sanit_is_jid(string):
    """
        Returns true if the string is a JID.
    """
    if string.count('@') != 1 or string.count('/') > 1:
        return False
    splitted = string.split('@')
    username = splitted[0]
    host = splitted[1]
    if host.count('.') > 1:
        return False
    host = host.replace('.', '')
    if '/' in host:
        host_resource = host.split('/')
        host = host_resource[0]
        resource = host_resource[1]
        if not resource.isalnum():
            return False
    return username.isalnum() and host.isalnum()
