import re


def parse_log(line):
    """Parse logs with regex

    Function that parse raw logs and extracts request_time and url

    Args:
        line: Decoded line

    Returns:
        reqest_time_data: float number or None if log can't be parsed
        url_data: String or None if log can't be parsed
    """

    url_format = re.compile(r"""((?:(?<=PUT )|(?<=GET )|(?<=POST )|(?<=HEAD ))(.*)(?=\ http))""", re.IGNORECASE)
    request_time_format = re.compile(r"""(([0-9]*[.])?[0-9]+(?!.*\d))$""", re.IGNORECASE)
    url_data = re.search(url_format, line)
    request_time_data = re.search(request_time_format, line)
    if url_data:
        url_data = url_data.group()
    if request_time_data:
        request_time_data = request_time_data.group()
    return request_time_data, url_data