def METHOD_NAME(line, line_re, line_name='ping'):
    line_match = line_re.match(line)
    if not line_match:
        raise ValueError(
            'Could not parse {name} line:\n{line}'.format(
                name=line_name,
                line=line,
            ),
        )
    return line_match