The following only matches a path that starts with private:
access_control:
#...
- { path: ^/private, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }
- { path: ^/private, roles: ROLE_NO_ACCESS }
How can I match all the routes that contain /private/ (and do not necessarily start with private)? For example, something that will match /message/private/blabla..
the equivalent of [path~="private"] with jQuery selectors.
Note: Does anyone know how we call the regex we are using here? Is this specific to yml or is this implemented by Symfony, I am confused. Is there a chance I missed this in the doc somewhere, I mean the description with the specific matching patterns like start with, end with, contains etc....
^/ this pattern says everything that starts (^) with slash (/) and so on.
I suppose that /private or something like */private should work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With