s='no'>string1</span>, <span class='fu'><a href='https://rdrr.io/r/base/grep.html'>regexpr</a></span>(<span class='no'>x</span>, <span class='no'>string1</span>))</div><div class='output co'>#&gt; [1] "foobar"</div><div class='input'><span class='co'># matches 'foo' and 'bar' separately</span>
<span class='fu'><a href='https://rdrr.io/r/base/regmatches.html'>regmatches</a></span>(<span class='no'>string2</span>, <span class='fu'><a href='https://rdrr.io/r/base/grep.html'>gregexpr</a></span>(<span class='no'