import re


def license_number(value, space=True):
    """
    Regex to validate is the string passed is a valid Zimbabwean driver's license
    :param value: The string passed
    :param space: (Optional) if you want a space between the first 6 numbers and the last two letters
    :return: boolean
    """

    is_valid = False
    if space:
        pattern = re.compile(r"^[0-9]{6}\s[a-zA-Z]{2}$")
    else:
        pattern = re.compile(r"^[0-9]{6}[a-zA-Z]{2}$")

    try:
        if re.fullmatch(pattern, value):
            is_valid = True
    except re.error:
        is_valid = False
    return is_valid