RegexDump/IvanB
RegexDump/pavel_yeltsin
f1import ref1import re
22
n3reTemplate = input()n3template = input()
4 
4inputStr = input()5inputStr = input()
n5 n
6while inputStr != "":6while inputStr != "":
n7    res = re.search(reTemplate, inputStr)n7    res = re.search(template, inputStr)
8    if res:8    if res:
n9        tmp = res.group()n9        buf = res.group()
10        print(f"{res.start()}: {tmp}")10        print(f"{res.start()}: {buf}")
11        for idx, group in enumerate(res.groups()):11        for index, group in enumerate(res.groups()):
12            if not group:12            if not group:
13                continue13                continue
t14            print(f"{idx+1}/{res.start(idx+1)}: {group}")t14            print(f"{index+1}/{res.start(index+1)}: {group}")
15        grDict = res.groupdict()15        groupDict = res.groupdict()
16        for name in grDict:16        for name in groupDict:
17            group = grDict[name]17            group = groupDict[name]
18            if not group:18            if not group:
19                continue19                continue
20            print(f"{name}/{res.start(name)}: {group}")20            print(f"{name}/{res.start(name)}: {group}")
21    else:21    else:
22        print("<NONE>")22        print("<NONE>")
23    inputStr = input()23    inputStr = input()
2424
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op