RegexDump/pavel_yeltsin
RegexDump/IvanB
f1import ref1import re
22
n3template = input()n3reTemplate = input()
4inputStr = input()
45
n5inputStr = input()n
6while inputStr != "":6while inputStr != "":
n7    res = re.search(template, inputStr)n7    res = re.search(reTemplate, inputStr)
8    if res:8    if res:
n9        buf = res.group()n9        tmp = res.group()
10        print(f"{res.start()}: {buf}")10        print(f"{res.start()}: {tmp}")
11        for index, group in enumerate(res.groups()):11        for idx, group in enumerate(res.groups()):
12            if not group:12            if not group:
13                continue13                continue
t14            print(f"{index+1}/{res.start(index+1)}: {group}")t14            print(f"{idx+1}/{res.start(idx+1)}: {group}")
15        groupDict = res.groupdict()15        grDict = res.groupdict()
16        for name in groupDict:16        for name in grDict:
17            group = groupDict[name]17            group = grDict[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