import re


def parse_ping_output(ping_output):
    """Parse ping output.

    Returns a tuple with the number of packets sent and the percentage of
    packet loss from a ping output."""
    match = re.search(
        '(\d*) packets transmitted, .* ([\d\.]*)\% packet loss',
        ping_output)
    return match.groups() if match is not None else None