Allow for parsing app route strings with and without slot names. (#92327)
The old impl has a boolean arg that was always true. To support some
fixes to routing I need to make the parser sometimes allow for slots but
still not things like route groups. I am generalizing the function
implementation to have a filter type that decides whether the input
string is allowed to have certain types such as route groups and slot
names. All the existing uses still disallow any non-url path segments.