I want to extract words between ";" and ":" from an XML file, for example the word " Index" here
bla bla bla ; Index : bla bla
the file is loaded by its URL using file_get_contents
$output = file_get_contents("https://fr.wikipedia.org/wiki/Sp%C3%A9cial:Exporter/Base_de_donn%C3%A9es");
preg_match_all('/\;.[a-zA-Z]+.\:/', $output, $matches, PREG_SET_ORDER, 0);
var_dump($matches);
The regex pattern works fine on the same file content using regex101 and also when I copy the text in a string variable. But the code above does Not work, it returns only the last match.
What am I doing wrong ?
PS : I also tried loading the XML file using DOMDocument.. same result.