title: Match all words with a specific length
body: <p>I want to make a regex that matches all words with a specific length.<br>
  Example of the string I have: 
  "I ABCDE FGH IG KLMNOPQ RS T"<br>
  I want to match all words having length less than 3 letters (In this case <code>I</code>, <code>IG</code>, <code>RS</code> and <code>T</code>).<br>
  Here are the alternatives that I made:<br>
  <strong>Alt1:</strong><br>
  <em>Regex:</em> <code>( |^)([A-Z]{1,2})( |$)</code>: <a href="https://regex101.com/r/IEncf5/1" rel="nofollow noreferrer">Link1</a><br>
  <em>Explanation:</em> Matching any word with a length of 2 or 1 uppercase letters that is preceded by a space or in the beginning of the string (<code>( |^)</code>) and followed by a space or at the end of the string (<code>( |$)</code>).</p>
  
  <p>The problem is that I get positive match for the blank spaces which I don't want. And I don't get match for the <code>T</code>.<br>
  <strong>Alt2:</strong><br>
  <em>Regex:</em> <code>\w{1,2}\b</code>: <a href="https://regex101.com/r/0RVOqQ/1" rel="nofollow noreferrer">Link2</a><br>
  <em>Explanation:</em> </p>
  
  <blockquote>
    <p>match a word of at most 2 characters as long as its the only contents of the string<br>
    (I found it in this <a href="https://stackoverflow.com/a/9043828/8128190">answer</a>)</p>
  </blockquote>
  
  <p>The problem is that I get matches of every last 2 letters from every word (<code>DE</code>, <code>GH</code> and <code>PQ</code>) which is wrong in my case.</p>