I’m aware of the danger of just matching anything.
I tried your regex. It did not work out of the box in the route, but this seems to work:
'pattern' => '(?!assets)(.*)',
Correct me if it’s wrong.
The reason for why I need it right now is this:
categories
category1
category2
pages
about
contact
I use parent pages as sections to group the pages, but I still want access to them from the root, like this:
example.com/category1
example.com/about
I just figured out that another way, instead of match all could be to generate some kind of whitelist and put that into the route pattern. That is probably only a good solution if there are not that many pages on the site.
As I said, I’m not here to judge. I’ve seen enough of your posts and plugins to know that you most likely have a good reason for whatever it is you’re doing. Once we get our route filters, everything will be fine
Your regex looks fine, I’m just never sure off the top of my head what the pattern expression actually matches against - whether it is the full path starting with ‘/’ or not.