Support RegExp expectations

Modify _expect() and _wait() to support both sub-string and RegExp
specifications of what output is expected.

@sam-github @indexzero
Could one of you review the patch please?