def port_match(dest_port, port_line):
    """
    Find if a given port number, as a string, could be defined as "in"
    an expression containing characters such as '*' and '-'.

    >>> port_match('80', '*')
    True
    >>> port_match('80', '79-81')
    True
    >>> port_match('80', '80')
    True
    >>> port_match('80', '443-9050')
    False

    @type dest_port: C{string}
    @param dest_port: The port to test for membership in port_line
    @type port_line: C{string}
    @param port_line: The port_line that dest_port is to be checked for
        membership in. Can contain * or -.
    @rtype: C{boolean}
    @return: True if dest_port is "in" port_line, False otherwise.
    """
    # If port_line is a wildcard character, dest_port is always 'in'
    # port_line
    if (port_line == '*'):
        return True

    # If port_line contains a dash, a range is given, so get upper
    # and lower bounds.
    if ('-' in port_line):
        lower_str, upper_str = port_line.split('-')
        lower_bound = int(lower_str)
        upper_bound = int(upper_str)
        dest_port_int = int(dest_port)

        if (dest_port_int >= lower_bound and
            dest_port_int <= upper_bound):
            return True

    # If the dest_port is exactly the port_line, then dest_port is
    # 'in' port_line
    if (dest_port == port_line):
        return True

    # port_line must either be a port number, a range of port numbers,
    # or a wildcard character, so if no matches are found, return False
    return False