8

how to use regex in switch case in expect script?

view full story
linux-howto

http://stackoverflow.com – 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" } but if i have to use regex such as | or & staement like in unix.how do i use it the below example does not work in 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.also if i set a an array variable say : how do i use such statements in switch or may be an and staement (HowTos)