nl: call the method re.compile with 2 arguments: raw string """^(?: (?P<addr> (?P<ipv4>\d{1,3}(?:\.\d{1,3}){3}) |"""
code: naiveip_re = re . compile ( r"""^(?: (?P<addr> (?P<ipv4>\d{1,3}(?:\.\d{1,3}){3}) | # IPv4 address (?P<ipv6>\[[a-fA-F0-9:]+\]) | # IPv6 address (?P<fqdn>[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*) # FQDN ):)?(?P<port>\d+)$""" , re . X )