import re
txt = '<li>one. URL : <a href="http://local.ru">http://local.ru</a> (10.02.2022).</li><li>Two</li><li>Three. URL : <a href="https://local.ru">https://local.ru</a> (15.11.2021).</li>'
re.findall(r'(<li>.*?)\s?URL\s?:\s?(<a.*?>).*?(</a>.*?</li>)', txt)
I need gen output
[('<li>one.', '<a href="http://local.ru">', '</a> (10.02.2022).</li>'),
('<li>Three.', '<a href="https://local.ru">', '</a> (15.11.2021).</li>')]
If without the first brackets, then it works. But it does not output the text