Normally, switch case in expect looks like this:
switch -- $count \
1 {
set type byte
} 2 {
set type word
} big {
set type array
} default {
puts "$count is not a valid type"
}
I need to use regex operators such as | or & - how can I do that?
The below example does not work with expect code :
switch -- $variable \
("a"|"b"|"c") {
do something
}
("a"|"b"|"c") represents a or b or c, but it does not seem to work.
How do I use such statements in switch or may be an and statement?