import re


def colorstr_to_plainstr(string):
    """Conversion from colour string to plain string if any"""
    ansi_escape = re.compile(r"\x1b(\[.*?[@-~]|\].*?(\x07|\x1b\\))")
    format_string = ansi_escape.sub("", str(string))
    return format_string