diff --git a/src/Composer/Package/BasePackage.php b/src/Composer/Package/BasePackage.php index ea58b5f2a..2e8b2ca3b 100644 --- a/src/Composer/Package/BasePackage.php +++ b/src/Composer/Package/BasePackage.php @@ -130,7 +130,7 @@ abstract class BasePackage implements PackageInterface */ public static function parseVersion($version) { - if (!preg_match('#^v?(\d+)(\.\d+)?(\.\d+)?-?(?:(beta|RC\d+|alpha|dev)?\d*)$#i', $version, $matches)) { + if (!preg_match('#^v?(\d+)(\.\d+)?(\.\d+)?-?((?:beta|RC\d+|alpha|dev)\d*)?$#i', $version, $matches)) { throw new \UnexpectedValueException('Invalid version string '.$version); }