If I want to match DEF_23 using the following regexp:
DEF_23
expect { -re \"DEF_\\[0-9]*\" set result $expect_out(1,string) }
why
Aleksandar - it should work if you change the match to "\ndb.*$".
If you turn on exp_internal 1, you will see the buffer contains something like this: "ls -1 db*\r\ndbupgrade.log\r\n08:46:09"
So, the caret (^) will throw your pattern match off.