diff --git a/core/lib/Drupal/Core/Routing/RouteProvider.php b/core/lib/Drupal/Core/Routing/RouteProvider.php
index 9c660e8..f1b49e3 100644
--- a/core/lib/Drupal/Core/Routing/RouteProvider.php
+++ b/core/lib/Drupal/Core/Routing/RouteProvider.php
@@ -254,7 +254,8 @@ protected function getRoutesByPath($path) {
     $collection = new RouteCollection();
     foreach ($routes as $name => $route) {
       $route = unserialize($route);
-      if (preg_match($route->compile()->getRegex(), $path, $matches)) {
+      // Only validate the path, if the path does not contain any placeholders.
+      if (strpos($path, '%') !== FALSE || preg_match($route->compile()->getRegex(), $path, $matches)) {
         $collection->add($name, $route);
       }
     }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/RouteProviderTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/RouteProviderTest.php
index 1eafdf6..224cba4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Routing/RouteProviderTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Routing/RouteProviderTest.php
@@ -363,6 +363,25 @@ function testSystemPathMatch() {
   }
 
   /**
+   * Tests RouteProvider::getRouteByPattern with an actual pattern and a regex.
+   */
+  public function testGetRouteByPatternWithRegex() {
+    $connection = Database::getConnection();
+    $provider = new RouteProvider($connection, 'test_routes');
+
+    $this->fixtures->createTables($connection);
+
+    $dumper = new MatcherDumper($connection, 'test_routes');
+    $dumper->addRoutes($this->fixtures->complexRouteCollection());
+    $dumper->dump();
+
+    $routes_by_pattern = $provider->getRoutesByPattern('/path/{thing}/two');
+    $this->assertEqual($routes_by_pattern->count(), 1);
+    $this->assertEqual($routes_by_pattern->get('route_f'), $this->fixtures->complexRouteCollection()->get('route_f'));
+  }
+
+
+  /**
    * Test RouteProvider::getRouteByName() and RouteProvider::getRoutesByNames().
    */
   protected function testRouteByName() {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/RoutingFixtures.php b/core/modules/system/lib/Drupal/system/Tests/Routing/RoutingFixtures.php
index 06f0953..5f5e4eb 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Routing/RoutingFixtures.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Routing/RoutingFixtures.php
@@ -102,6 +102,11 @@ public function complexRouteCollection() {
     $route->setRequirement('_method', 'GET|HEAD');
     $collection->add('route_e', $route);
 
+    $route = new Route('/path/{thing}/two');
+    $route->setRequirement('_method', 'PUT');
+    $route->setRequirement('thing', '\d+');
+    $collection->add('route_f', $route);
+
     return $collection;
   }
 
