and re.IGNORECASE, substitute the result for simple_url_re. call the function re.compile with raw string '&(?!(\w+|#\d+);)', substitute the result for simple_email_re.
simple_email_re = re . compile ( r'^\S+@\S+\.\S+$' )