switch -glob (or -regexp) for multiple directories
I have some URLs that I want to match in a switch statement and I'm having trouble matching those cases where multple slashes appear before the uri name. For example:
- /uri
- //uri
- ////uri
- /completely/valid/uri
My existing switch -glob used a pattern like this: */uri*
This turned out to be way too liberal in that even though it matched the first three entries in my list, it would also match the fourth, which I do not want. The fourth item is a completely valid application path that just so happens to have a directory name that is the same as the entry I want to restrict at a higher level.
I'm wondering if there is a glob I should be using that will match what I am looking to match or if I need to consider using switch -regexp instead. I've read that there are cpu concerns using -regexp, so it would be nice to not have to go there if I don't need to. If I do go the -regexp route, should an expression like "\B/+uri" work?