Don't use shorthand match on routes with inappropriate symbols

Fixes exception from #18211
Test in this pull-request shows an example.
That is to say that `foo/bar` route will continue to work as previously (there are tests that cover this behavior and they all pass).