Match multiple times a group in a string <p>i'am trying to use regular expression. I have this string that has to be matched</p> <pre><code> influences = {{hlist |[[Plato]] |[[Aristotle]] |[[Socrates]] |[[David Hume]] |[[Adam Smith]] |[[Cicero]] |[[John Locke]]}} {{hlist |[[Saint Augustine]] |[[Saint Thomas Aquinas]] |[[Saint Thomas More]] |[[Richard Hooker]] |[[Edward Coke]]}} {{hlist |[[Thomas Hobbes]] |[[Rene Descartes]] |[[Montesquieu]] |[[Joshua Reynolds]] |[[Sir William Blackstone|William Blackstone]]}} {{hlist |[[Niccolo Machiavelli]] |[[Dante Alighieri]] |[[Samuel Johnson]] |[[Voltaire]] |[[Jean Jacques Rousseau]] |[[Jeremy Bentham]]}} </code></pre> <p>I would like to extract from the text the following templates: </p> <pre><code>{{hlist .... }} </code></pre> <p>Instead, the following text has not to be matched:</p> <pre><code>main_interests = {{hlist |[[Music]] |[[Art]] |[[Theatre]] |[[Literature]]}} </code></pre> <p>I wrote this regex but it doesn't work</p> <pre><code>(?:^\|\s*)?(?:influences)\s*?=\s*?(?:(?:\s*\{\{hlist)\s*\|([\d\w\s\-()*—&amp;;\[\]|#%.&lt;&gt;·:/",\'!{}=•?’ á~ü°œéö$àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇßØøÅåÆæœ]*?)(?=\n))+ </code></pre> <p>I'm using python.</p>