From 87b7de4d0a5b9adcd5199a6b77c1fff46a5ff5e2 Mon Sep 17 00:00:00 2001 From: Chris Brand Date: Mon, 26 Jan 2015 17:07:58 +0200 Subject: [PATCH] Add the P character to the regex pattern According to http://php.net/manual/en/function.preg-match.php and some other sources named groups should contain a 'P' character after the '?' Without this, I receive the following error when running an update: [ErrorException] preg_match(): Compilation failed: unrecognized character after (?< at offset 4 Exception trace: () at phar:///var/www/git/smmqa/app/admin/composer.phar/src/Composer/Package/Version/VersionParser.php:181 --- src/Composer/Package/Version/VersionParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Package/Version/VersionParser.php b/src/Composer/Package/Version/VersionParser.php index d546b2655..9707ac017 100644 --- a/src/Composer/Package/Version/VersionParser.php +++ b/src/Composer/Package/Version/VersionParser.php @@ -178,7 +178,7 @@ class VersionParser */ public function parseNumericAliasPrefix($branch) { - if (preg_match('/^(?(\d+\\.)*\d+)(?:\.x)?-dev$/i', $branch, $matches)) { + if (preg_match('/^(?P(\d+\\.)*\d+)(?:\.x)?-dev$/i', $branch, $matches)) { return $matches['version']."."; }