I have a question about expect/tcl,
I expect the following
expect "class room: classroom 1"
send "classroom"
send "classroom" will return "class room: classroom 1"
but this does not match, because the expected matching become
class room: classroom 1:
how to handle the “:” in expect?
First piece of advice for developing an expect program: before you
spawnuse this commandThat will show you what expect sees, and you can see how it does and does not match your expected patterns.
Next, you can specify regular expressions for your patterns with
expect -re {^pattern$}. The default pattern mode is glob-style matching, which is documented in Tcl’s string match command. Tcl regular expressions are documented here.Do you want to code this: