Repository: statamic/cms (PHP)

Issue:
Can't search assets in asset browser stack in Runway
### Bug description

I use Duncan's Runway, and in the CP (in Runway) attempt to update an asset field. In the stacked asset browser, when I search, the url used gets matched to the wrong CP route, do to extra url segments.

However I can reproduce the issue using Tinkerwell.

Assume you have an asset container with the handle `private` and a folder hierarchy `sponsor-an-orphan/updates`. The url used in the search query is `https://zakat.test/cp/assets/browse/search/private/sponsor-an-orphan/updates?page=1&perPage=100&search=abdul` which gets matched to the wrong route:

<img width="1289" alt="CleanShot 2023-01-05 at 16 49 10@2x" src="https://user-images.githubusercontent.com/6069653/210907372-f5ed6467-09ef-4810-a2e3-57aeaa369d06.png">

Note that the above route is NOT the correct search one. If you remove the last segment, the routing is correct:

<img width="1320" alt="CleanShot 2023-01-05 at 16 49 52@2x" src="https://user-images.githubusercontent.com/6069653/210907426-aa1b54ae-adca-47b4-84cd-16794dec264b.png">


### How to reproduce

In Tinkerwell, try to resolve `http://yoursite.test/cp/assets/browse/search/private/foo/bar?page=1&perPage=100&search=abdul` and look at the matched route, it's this one:

<img width="1220" alt="CleanShot 2023-01-05 at 16 52 04@2x" src="https://user-images.githubusercontent.com/6069653/210907640-0a1f30b1-3b00-456d-a7a1-a13fa6ef9bf9.png">

Then take out the last segment and re-try

### Logs

_No response_

### Environment

```yaml
Environment
Application Name: Statamic
Laravel Version: 9.46.0
PHP Version: 8.1.13
Composer Version: 2.5.1
Environment: local
Debug Mode: ENABLED
URL: zakat.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: daily
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 19
Antlers: runtime
Stache Watcher: Disabled
Static Caching: Disabled
Version: 3.3.58 PRO

Statamic Addons
aryehraber/statamic-captcha: 1.9.1
aryehraber/statamic-impersonator: 2.4.1
doublethreedigital/duplicator: 2.3.4
doublethreedigital/runway: 2.4.3
edalzell/forma: 1.2
jacksleight/statamic-bard-mutator: 1.1.2
jacksleight/statamic-bard-texstyle: 1.0.3
jonassiewertsen/statamic-livewire: 2.9.0
statamic/seo-pro: 3.1.3
swiftmade/statamic-clear-assets: 1.1.0
transformstudios/events: 4.0.7
transformstudios/front: 1.11.0
transformstudios/gated: dev-main
transformstudios/github: dev-main
transformstudios/magic-link: dev-main
transformstudios/memorial: dev-feature/switch-orphan-email-update
transformstudios/review: 3.7.0
transformstudios/simple: 2.18.1
transformstudios/takeover-redirects: dev-main
```


### Installation

Fresh statamic/statamic site via CLI

### Antlers Parser

runtime (new)

### Additional details

_No response_



Fix (patch):
diff --git a/routes/cp.php b/routes/cp.php
index e115e215cfb..d367911eeda 100644
--- a/routes/cp.php
+++ b/routes/cp.php
@@ -134,7 +134,7 @@
         Route::post('assets/actions', 'ActionController@run')->name('assets.actions.run');
         Route::post('assets/actions/list', 'ActionController@bulkActions')->name('assets.actions.bulk');
         Route::get('assets/browse', 'BrowserController@index')->name('assets.browse.index');
-        Route::get('assets/browse/search/{asset_container}/{path?}', 'BrowserController@search');
+        Route::get('assets/browse/search/{asset_container}/{path?}', 'BrowserController@search')->where('path', '.*');
         Route::post('assets/browse/folders/{asset_container}/actions', 'FolderActionController@run')->name('assets.folders.actions.run');
         Route::get('assets/browse/folders/{asset_container}/{path?}', 'BrowserController@folder')->where('path', '.*');
         Route::get('assets/browse/{asset_container}/{path?}/edit', 'BrowserController@edit')->where('path', '.*')->name('assets.browse.edit');