└── README.md /README.md: -------------------------------------------------------------------------------- 1 | import re 2 | import sys 3 | 4 | N = int(input()) 5 | text = sys.stdin.read() 6 | comm_re = '' 7 | text = re.sub(comm_re, "", text) 8 | 9 | content_re = r'<(\w+.*?)/?>' 10 | contents = re.findall(content_re, text, re.DOTALL) 11 | 12 | tag_re = r'(\w+) ?' 13 | att_re = r'([\w\-]+)=\"([\s\S]*?)\"' 14 | 15 | for con in contents: 16 | tag = re.finditer(tag_re, con) 17 | print(next(tag).group().strip()) 18 | 19 | attrs = re.findall(att_re, con) 20 | 21 | for att in attrs: 22 | print(f'-> {att[0]} > {att[1]}') 23 | --------------------------------------------------------------------------------