I am having trouble with this expression:
preg_match('#<file(.*)source-language="(.){2}"(.*)>#Ui', $xliff, $matches);
I am trying to get the ‘en’ out of (exactly 2 a-z characters can be there):
<file src="index.php" source-language="en" date="2012-10-10">
You’ve got the quantifier outside the capture section. You need to move the {2} inside the () so that both get captured.