Regex : récupérer un tableau associatif
Cela peut être fait avec :
<?php
preg_match_all ("#^$project \((?P<version>[0-9-.]+)-\d+\) (?P<state>\w+); .+$".
"(?P<changes>.+)".
"^ -- (?P<maintainerName>.+) <(?<maintainerMail>.+)> ".
"(?P<published>.+)$".
"#smU", $changelog, $changelogReleases);
print_r ($changelogReleases);
On obtient ainsi un tableau contenant les indexes "version", "state", "changes"...
Voir http://fr2.php.net/manual/en/function.preg-match-all.php#example-5380