Quelle est la regex pour une telle tâche? -> remplacer "[[...:" par "[["Quelle est la bonne regex pour cela?
C'est-à-dire, je veux remplacer * du texte * à l'intérieur [[...: avec [[.
Le problème avec mon code est qu'il supprime * texte * à l'intérieur du premier [[]]
>>> string = "Some text here [[dont remove me]] and some extra text [[remove me:and let this]] here."
>>> clean = re.sub(r'\[\[.+:', '[[', string)
>>> clean
'Some text here [[and let this]] here.'
>>>
Merci, ça fonctionne très bien)) – Gusto