s="st">&quot;a&quot;</span>)</span>
<span id="cb4-8"><a href="#cb4-8" tabindex="-1"></a><span class="co">#&gt; [1] 1 3 1 1</span></span></code></pre></div>
<p>This information can be gleaned from <code>gregexpr()</code> in base,
but you need to look at the <code>match.length</code> attribute as the
vector uses a length-1 integer vector (<code>-1</code>) to indicate no
match.</p>
</div>
<div id="str_locate-locate-the-position-of-patterns-in-a-string" class="section level2">
<h2><code>str_locate()</code>: Loc