I have a wiktionary dump and struggling with finding appropriate regex pattern to remove the double brackets in the expression. Here is the example of the expressions:
line = "# Test is a cool word {{source|{{nom w pc|Chantal|Bouchard}}, ''La langue et le nombril'', Presses de l'Université de Montréal (PUM), 2020, p. 174}}."
I am looking to remove all of the brackets when is begins with {{source|:
Example :# Test is a cool word.
I tried using re.sub like this line = re.sub("{{source\|.*?}}", "", line )
but I got # Test is a cool word, ''La langue et le nombril'', Presses de l'Université de Montréal (PUM), 2020, p. 174}}.
I could also have another sentence like this line = "# Test is a cool word {{source|Nicolas|Daniel, Presses de l'Université de Montréal 4}}"
Thank you for your help!