There is a nice pear library. File_Gettext
If you look at the source File/Gettext/PO.php you see the regex pattern that you'll need:
$matched = preg_match_all('/msgid\s+((?:".*(?<!\\\\)"\s*)+)\s+' .
'msgstr\s+((?:".*(?<!\\\\)"\s*)+)/',
$contents, $matches);
for ($i = 0; $i < $matched; $i++) {
$msgid = substr(rtrim($matches[1][$i]), 1, -1);
$msgstr = substr(rtrim($matches[2][$i]), 1, -1);
$this->strings[parent::prepare($msgid)] = parent::prepare($msgstr);
}
Or just use the pear lib:
include 'File/Gettext/PO.php';
$po = new File_Gettext_PO();
$po->load($poFile);
$poArray = $po->toArray();
foreach ($poArray['strings'] as $msgid => $msgstr) {
// write your csv as you like...
}