import re
regex = re.compile(r"<\S(?:\s*.*?)>", flags=re.MULTILINE)
test_str = "<p class=\"MsoNormal\" style=\"line-height: normal; margin-bottom: 6pt;\" align=\"justify\">Les RPS conformément à la méthodologie, ne figurent pas dans cette analyse mais sont bien pris en compte. Il conviendra dans le cadre des RPS que l'outil peut être désactivé en dehors des heures normales de service (équilibre vie privée vie professionnelle).<br /></p>Rappels des modalités d'application des règles d’< ut< il>>isat< ion <i>ssues des </i>dispositions < générales décrites dans l’IN 7994<"
matches = regex.finditer(test_str)
for match_num, match in enumerate(matches, start=1):
print(f"Match {match_num} was found at {match.start()}-{match.end()}: {match.group()}")
for group_num, group in enumerate(match.groups(), start=1):
print(f"Group {group_num} found at {match.start(group_num)}-{match.end(group_num)}: {group}")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html