def extract_reviewer(string):
    """
    Takes the string on the input and looks for a specific set of characters
    (either "r=" or "a=").
    If at least one of them are present (most of the times they are in the
    mercurial world) then this function will return the reviewer/approved by
    names.
    If none of them are present, the function will return an empty string.
    :param string: usually the commit message.
    :return: a string that may contain the author name (if "r=" or "a=" exists)
    """
    reviewer = ""
    approved_by = ""
    try:
        reviewer = string.split("r=")[1].split()[0]
    except IndexError:
        pass
    try:
        approved_by = string.split("a=")[1].split()[0]
    except IndexError:
        pass

    if len(reviewer) < 1:
        return approved_by
    else:
        return reviewer