span class="fu">length</span>(<span class="fu">attr</span>(x, <span class="st">&quot;match.length&quot;</span>)))</span>
<span id="cb4-4"><a href="#cb4-4" tabindex="-1"></a><span class="co">#&gt; [1] 1 3 1 1</span></span>
<span id="cb4-5"><a href="#cb4-5" tabindex="-1"></a></span>
<span id="cb4-6"><a href="#cb4-6" tabindex="-1"></a><span class="co"># stringr</span></span>
<span id="cb4-7"><a href="#cb4-7" tabindex="-1"></a><span class="fu">str_count</span>(fruit, <span class="at">pattern =</span> <span clas