and re.VERBOSE, substitute the result for accept_language_re. call the function re.compile with 2 arguments: raw string '^[a-z]{1,8}(?:-[a-z0-9]{1,8})*$' and re.IGNORECASE,
language_code_re = re . compile ( r'^[a-z]{1,8}(?:-[a-z0-9]{1,8})*$' , re . IGNORECASE )