title: Password prompt using Expect not working
body: <p>I need to accept a password from keyboard containing at least one number, at least one uppercase letter, at least one lowercase letter and optional symbols # &amp; - I wrote the following code. It always times out, but not detecting the password... Can anyone help</p>
  
  <pre><code>package require Expect
  log_user 0
  send "Enter Password\n"
  expect  {
  -re {(?=.*?[0-9])(?=.*?[a-z])(?=.*?[A-Z])[a-zA-Z0-9#&amp;-]*} {send "Password ok"}
      timeout { send "Time out" }
      }
  </code></pre>
  
  <p>I had edited the code and now it is working only if the password is given in correct format at the first try...If a wrong format is given in the first try, expect will wait for the next try. But even if the next entry is correct, Expect is not detecting it and is going for the next try and finally time outs</p>