<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="ExpectPcre.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Expect" rel="Chapter" href="Expect.html"> <link title="ExpectPcre" rel="Chapter" href="ExpectPcre.html"> <link title="ExpectStr" rel="Chapter" href="ExpectStr.html"><title>ExpectStr</title> </head> <body> <div class="navbar"><a class="pre" href="ExpectPcre.html" title="ExpectPcre">Previous</a> <a class="up" href="index.html" title="Index">Up</a> </div> <h1>Module <a href="type_ExpectStr.html">ExpectStr</a></h1> <pre><span class="keyword">module</span> ExpectStr: <code class="code">sig</code> <a href="ExpectStr.html">..</a> <code class="code">end</code></pre><div class="info module top"> Extend Expect module with Str matches. <p> This module extends <a href="Expect.html#VALexpect"><code class="code">Expect.expect</code></a> to also handle <code class="code">Str</code> regular expression. You can use `Regexp to provide the <code class="code">Str.regexp</code>. <p> <pre class="codepre"><code class="code">open Expect open ExpectStr let (), _ = with_spawn "ls" [| "-alh" |] (fun t () -> if expect t [`Regexp (Str.regexp "\\."), true] false then prerr_endline "'.' found") () </code></pre><br> <b>Author(s):</b> Sylvain Le Gall<br> </div> <hr width="100%"> <pre><span id="VALexpect"><span class="keyword">val</span> expect</span> : <code class="type"><a href="Expect.html#TYPEt">Expect.t</a> -><br> ?fmatches:(string -> 'a option) list -><br> ([< `Contains of string<br> | `Eof<br> | `Exact of string<br> | `Fun of string -> bool<br> | `Prefix of string<br> | `Regexp of Str.regexp<br> | `Suffix of string<br> | `Timeout ] *<br> 'a)<br> list -> 'a -> 'a</code></pre><div class="info "> See <a href="Expect.html#VALexpect"><code class="code">Expect.expect</code></a>.<br> </div> </body></html>