Index: src/wp-includes/rest-api/class-wp-rest-server.php
===================================================================
--- src/wp-includes/rest-api/class-wp-rest-server.php	(revision 41221)
+++ src/wp-includes/rest-api/class-wp-rest-server.php	(working copy)
@@ -824,12 +824,19 @@
 		$path   = $request->get_route();
 
 		foreach ( $this->get_routes() as $route => $handlers ) {
-			$match = preg_match( '@^' . $route . '$@i', $path, $args );
+			$match = preg_match( '@^' . $route . '$@i', $path, $matches );
 
 			if ( ! $match ) {
 				continue;
 			}
 
+			$args = array();
+			foreach ( $matches as $param => $value ) {
+				if ( ! is_int( $param ) ) {
+					$args[ $param ] = $value;
+				}
+			}
+
 			foreach ( $handlers as $handler ) {
 				$callback  = $handler['callback'];
 				$response = null;
Index: tests/phpunit/tests/rest-api/rest-server.php
===================================================================
--- tests/phpunit/tests/rest-api/rest-server.php	(revision 41221)
+++ tests/phpunit/tests/rest-api/rest-server.php	(working copy)
@@ -163,6 +163,26 @@
 	}
 
 	/**
+	 * @ticket 40704
+	 */
+	public function test_url_params_no_numeric_keys() {
+
+		$this->server->register_route( 'test', '/test/(?P<data>.*)', array(
+			array(
+				'methods'  => WP_REST_Server::READABLE,
+				'callback' => '__return_false',
+				'args'     => array(
+					'data' => array(),
+				),
+			),
+		) );
+
+		$request = new WP_REST_Request( 'GET', '/test/some-value' );
+		$this->server->dispatch( $request );
+		$this->assertEquals( array( 'data' => 'some-value' ), $request->get_params() );
+	}
+
+	/**
 	 * Pass a capability which the user does not have, this should
 	 * result in a 403 error.
 	 */
