Fix color codes breaking urls

This updates the regex to ignore format codes at the beginning and end of a URL. The check also needed to be done on colour change because the builder was getting cleared before reaching the next space if the format code was at the end of the URL