(hostname)
return pattern.match(hostname) is not None
Check to see if the address is a .onion.
    returns the onion address as a string if True else returns False
Check to see if the address is a .onion.
    returns the onion address as a string if True else returns False
Check to see if the address is a . onion . returns the onion address as a string if True else returns False
def is_onion(hostname):
    """
    Check to see if the address is a .onion.
    returns the onion address as a string if True else returns False
    """
    pattern = re.compile('^([a-z0-9]){16,56}.onion$')
    return pattern.match(hostname) is not None
def is_onion ( hostname ) : pattern = re . compile ( '^([a-z0-9]){16,56}.onion$' ) return pattern . match ( hostname ) is not None