import sys import re with open('index.php', 'r') as f: content = f.read() # First, let's restore the thread loop (the first one) thread_loop_pattern = r'<\?php foreach\(\$messages as \$m\):.*?\<\?php endforeach; \?\>' # We need a non-greedy regex that handles nested PHP tags # Actually, it's easier to find the markers. # Let's find the first foreach($messages as $m) # and the first endforeach after it. # I'll just use a simpler approach: # Find everything between
Découvrez et gérez les événements à venir.
Cliquez sur "Ajouter un événement" pour commencer.
Veuillez accepter les règles pour obtenir l'accès complet.
Cliquez sur un bouton pour vous attribuer ou vous retirer un rôle.
C'est le début du salon #.