Pockets in Python's match method
When working with the match method, you can split the found substring into pockets.
Let's say we have a line:
pythontxt = '12 34 56'
Let's find the first substring with numbers and split it into two pockets:
pythonres = re.match('(\d+)(\d+)', txt)
print(res[0]) # '12'
print(res[1]) # '1'
print(res[2]) # '2'
Задание 1
Given a string:
pythontxt = ' 1234'
Find the domain located at the beginning of the line and put its name in the first pocket and the zone in the second.
Задание 2
Given a string containing a domain:
pythontxt = 'sss domain.ru zzz'
Find this domain and put its name in the first pocket and the zone in the second.
Задание 3
Given a string containing a date:
pythontxt = '31.12.2025'
Place the day in the first pocket, the month in the second, and the year in the third.