RegexDump/Stephan
RegexDump/IvanB
f1import ref1import re
22
n3p = input()n3reTemplate = input()
4 
5inputStr = input()4inputStr = input()
65
7while inputStr != "":6while inputStr != "":
n8    res = re.search(p, inputStr)n7    res = re.search(reTemplate, inputStr)
9    if res:8    if res:
t10        k = res.group()t9        tmp = res.group()
11        print(f"{res.start()}: {k}")10        print(f"{res.start()}: {tmp}")
12        for idx, group in enumerate(res.groups()):11        for idx, group in enumerate(res.groups()):
13            if not group:12            if not group:
14                continue13                continue
15            print(f"{idx+1}/{res.start(idx+1)}: {group}")14            print(f"{idx+1}/{res.start(idx+1)}: {group}")
16        grDict = res.groupdict()15        grDict = res.groupdict()
17        for name in grDict:16        for name in grDict:
18            group = grDict[name]17            group = grDict[name]
19            if not group:18            if not group:
20                continue19                continue
21            print(f"{name}/{res.start(name)}: {group}")20            print(f"{name}/{res.start(name)}: {group}")
22    else:21    else:
23        print("<NONE>")22        print("<NONE>")
24    inputStr = input()23    inputStr = input()
2524
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op