e
  with
  | _ -&gt; true
in
v = true</code></pre><p>Specify upper bound <code>up_to</code>.</p><pre><code>module P = Reparse.String

;;
let p = P.(take ~up_to:3 ~sep_by:(char ',') (char 'a')) in
let v = P.parse_string p &quot;a,a,a,a,a&quot; in
v = [ 'a'; 'a'; 'a' ]</code></pre></div></div><div class="odoc-spec"><div class="spec value" id="val-take_while_cb" class="anchored"><a href="#val-take_while_cb" class="anchor"></a><code><span><span class="keyword">val</span> take_while_cb : <span>?sep_by:<span><spa