call the function re.compile with 2 arguments: raw string '^https?://\[?\w' and re.IGNORECASE, substitute the result for simple_url_re.
simple_url_re = re . compile ( r'^https?://\[?\w' , re . IGNORECASE )