t | import re | t | import re |
| cndtn = input() | | cndtn = input() |
| s = [] | | s = [] |
| a = input() | | a = input() |
| while a: | | while a: |
| s.append(a) | | s.append(a) |
| a = input() | | a = input() |
| for i in range(len(s)): | | for i in range(len(s)): |
| m = re.search(cndtn, s[i]) | | m = re.search(cndtn, s[i]) |
| if m is None: | | if m is None: |
| print("<NONE>") | | print("<NONE>") |
| else: | | else: |
| print(m.start(), m.group(), sep=": ") | | print(m.start(), m.group(), sep=": ") |
| for j in enumerate(m.groups()): | | for j in enumerate(m.groups()): |
| if m.group(j[0]+1): | | if m.group(j[0]+1): |
| print( | | print( |
| j[0]+1, | | j[0]+1, |
| "/", | | "/", |
| m.start( | | m.start( |
| j[0]+1), | | j[0]+1), |
| ": ", | | ": ", |
| m.group( | | m.group( |
| j[0]+1), | | j[0]+1), |
| sep="") | | sep="") |
| if m.groupdict(): | | if m.groupdict(): |
| for item in m.groupdict(): | | for item in m.groupdict(): |
| if m.group(item): | | if m.group(item): |
| print( | | print( |
| item, | | item, |
| "/", | | "/", |
| m.start(item), | | m.start(item), |
| ": ", | | ": ", |
| m.group(item), | | m.group(item), |
| sep="") | | sep="") |
| | | |