diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Repository/PlatformRepository.php
+++ b/src/Composer/Repository/PlatformRepository.php
@@ -30,7 +30,7 @@ class PlatformRepository extends ArrayRepository
             $prettyVersion = PHP_VERSION;
             $version = $versionParser->normalize($prettyVersion);
         } catch (\UnexpectedValueException $e) {
-            $prettyVersion = preg_replace('#^(.+?)(-.+)?$#', '$1', PHP_VERSION);
+            $prettyVersion = preg_replace('#^([^~+-]+).*$#', '$1', PHP_VERSION);
             $version = $versionParser->normalize($prettyVersion);
         }
Add support for ~/+ in addition to - as separator between PHP version and build details, fixes #<I>