Script help

Hi All,
I am using expect to carry out some automation tasks such as password changes on multiple nodes.

When spawning the session to relivant nodes we have a security warning prior to the prompt for the password. Is there a way of getting expect to only look for a string of words instead of the entire paragraph that is output ?

I have removed the top part of this warning however this is the sort of thing I am looking at (I have highlighted the string i would like expect to just wait for.

set timeout 20
set user [lindex $argv 0]
set password [lindex $argv 1]
spawn ssh "$user\@***********
 
Unauthorised access and/or modification of data contained within this system is a criminal offence under the Computer Misuse Act 1990.
Please note that all access attempts, commands entered and keystrokes may be logged for security purposes and, by continuing, you consent to this.
*********@************ password:
 

Any help you can offer is much appreacited.

Just one example:

expect {
    # Send password at 'Password' prompt and tell expect to continue(i.e. exp_continue)
    # processing responses staying in this 'expect' block.
    # 'exp_continue' avoids having to write a another expect statement( think of it kinda like a loop, I said kinda )
  -re "\[P|p]assword:" { exp_send "$space1\r" 
                           exp_continue  }
  timeout              { return 1      }
  eof                  { return $expect_out(buffer) }
}