Forum Discussion
hooleylist
Jul 19, 2012Cirrostratus
I thought I replied to this yesterday. Somehow it got lost in the ether.
switch -glob uses the same pattern matching as string match. string match does not support the {a,d,f} syntax. I think that's for shell syntax only.
You can use [adf] though to match any characters in the character class. For switch you could also use hyphens to take the same action for multiple matches:
switch -glob $letter {
a -
d -
f {
Matched a d or f
}
}
Or:
switch -glob $letter {
[adf] {
Matched a d or f
}
}
Aaron