If I want to match DEF_23 using the following regexp:

expect {
    -re "DEF_\[0-9]*"
    set result $expect_out(1,string)
}

why does it say no such element in array? How does $expect_out work, and how can I capture the DEF using a regexp and assign it to the variable result?

Edit
Report