\n tagger = re.compile(""" (?:\n \\s+\n (?P<attr>[\\w\\d]+) # Attribute name\n \\s*=\\s*(?P<val> # = value\n [^\\s>\\"\\'][^\\s>]* | # unquoted values\n \\"[^\\"]*\\" | # Double-quoted values\n \\'[^\\']*\\' | # Single-quoted values\n )\n |\n \\s*> # End of tag\n )\n """,\n re.VERBOSE|re.IGNORECASE)\n