Forum Discussion
Kai_Wilke
Feb 01, 2016MVP
Hi Vova V,
the
switch -glob
matching pattern is very limited in its capabilities. Basically this is what it could do...
switch -glob -- [HTTP::uri] {
"/some/path/[A-z]-[0-9]/*" {
This would match /some/path/a-1/file.txt or /some/path/A-2/file.txt or /some/path/_-2/file.txt but not /some/path/bb-22/file.txt
}
"/some/path/[A-z][A-z][A-z]-[0-9][0-9][0-9]/*" {
This would match /some/path/abc-122/file.txt or /some/path/a_b-321/file.txt but not /some/path/a_cd-2234/file.txt
}
"/some/path/*-[0-9][0-9][0-9]/*" - "/some/path/*-[0-9][0-9][0-9][0-9]/*" {
This would match /some/path/a_bc-123/file.txt or /some/path/ab_cd_ef-gh-1234/file.txt or /some/path/1234-1234/file.txt or /some/path/abc/a/b/c/d-123/file.txt but not /some/path/a_b-22/file.txt or /some/path/a_b-222a/file.txt
}
"/some/path/*/*" {
This would match /some/path/aaa/file.txt or /some/path/123/file.txt or /some/path/abc123/file.txt but not /some/path/file.txt or /some/path2/abc_123/file.txt
}
default {
This would match everything else..
}
}
Cheers, Kai