Support RegExp expectations

Modify _expect() and _wait() to support both sub-string and RegExp
specifications of what output is expected.