title: Regex to match only uppercase "words" with some exceptions
body: <p>I have technical strings as the following:</p>
  
  <pre><code>"The thing P1 must connect to the J236 thing in the Foo position."
  </code></pre>
  
  <p>I would like to match with a regular expression those only-in-uppercase words (namely here <code>P1</code> and <code>J236</code>). The problem is that I don't want to match the first letter of the sentence when it is a one-letter word.</p>
  
  <p>Example, in:</p>
  
  <pre><code>"A thing P1 must connect ..." 
  </code></pre>
  
  <p>I want <code>P1</code> only, not <code>A</code> and <code>P1</code>. By doing that, I know that I can miss a real "word" (like in <code>"X must connect to Y"</code>) but I can live with it. </p>
  
  <p>Additionally, I don't want to match uppercase words if the sentence is all uppercase.</p>
  
  <p>Example:</p>
  
  <pre><code>"THING P1 MUST CONNECT TO X2."
  </code></pre>
  
  <p>Of course, ideally, I would like to match the technical words <code>P1</code> and <code>X2</code> here but since they are "hidden" in the all-uppercase sentence and since these technical words have no specific pattern, it's impossible. Again I can live with it because all-uppercase sentences are not so frequent in my files.</p>
  
  <p>Thanks!</p>