an id="cb4-1"><a href="#cb4-1" tabindex="-1"></a><span class="co"># base </span></span>
<span id="cb4-2"><a href="#cb4-2" tabindex="-1"></a>loc <span class="ot">&lt;-</span> <span class="fu">gregexpr</span>(<span class="at">pattern =</span> <span class="st">&quot;a&quot;</span>, <span class="at">text =</span> fruit, <span class="at">fixed =</span> <span class="cn">TRUE</span>)</span>
<span id="cb4-3"><a href="#cb4-3" tabindex="-1"></a><span class="fu">sapply</span>(loc, <span class="cf">function</span>(x) <