consecutive matches in regex (R)
<p>I'm trying to write a regex expression (under R) that matches all the words containing 3 letters in this text:</p>

<pre><code>tex= "As you are now so once were we"
</code></pre>

<p>My first attempt is to select words containing 3 letters surrounded by spaces:</p>

<pre><code>matches=str_match_all(tex," [a-z]{3} ")
</code></pre>

<p>It's supposed to match <strong>" you "</strong>, <strong>" are "</strong> and <strong>" now "</strong>. But, since some of these spaces are shared between the matched strings, I only get <strong>" you "</strong> and <strong>" now "</strong>.</p>

<p>Is there a way to fix this issue ?</p>

<p>Thanks in advance</p>