               </div>
                     <div class="examples">
                    <pre class="example"> <pre class="codepre"><code class="code">(* Finds and prints successive matches *)

let re = [%re "/ab*/g"] in
let str = "abbcdefabh" in

let break = ref false in
while not !break do
  match re |&gt; Js.Re.exec str with
  | None -&gt; break := true
  | Some result -&gt;
    Js.Nullable.iter (Js.Re.captures result).(0) ((fun match_ -&gt;
      let next = string_of_int (Js.Re.lastIndex re) in
      Js.lo