'Strip the trailing router prompt from the output.'

def strip_prompt(self, a_string):

    expect_string = u'^(OK|ERROR|Command    not    recognized\\.)$'
    response_list = a_string.split(u'\n')
    last_line = response_list[(-1)]
    if re.search(expect_string, last_line):
        return u'\n'.join(response_list[:(-1)])
    else:
        return a_string
