title: php regex - find uppercase string with number and spaces in text
body: <p>I want to write php regular expression to find uppercase string , which can also contain one number and spaces, from text.</p>
  
  <p>For example from this text <code>"some text to contain EXAM PL E 7STRING uppercase word"</code> I want to get string- <code>EXAM PL E 7STRING</code> ,  </p>
  
  <p>found string should start and end only with uppercase, but in the middle, without uppercase letters can also contain(but not necessarily ) one number and spaces. So, regex should match any of these patterns</p>
  
  <pre><code>1) EXAMPLESTRING               - just uppercase string
  2) EXAMP4LESTRING              - with number
  3) EXAMPLES TRING              - with space
  4) EXAM PL E STRING            - with more than one spaces
  5) EXAMP LE4STRING             - with number and space
  6) EXAMP LE 4ST RI NG          - with number and spaces 
  </code></pre>
  
  <p>and with total length string should be equal or more than 4 letters</p>
  
  <p>I wrote this regex <code>'/[A-Z]{1,}([A-Z\s]{2,}|\d?)[A-Z]{1,}/'</code>, that can find first 4 patterns, but I can not figure it out to match also the last 2 patterns.</p>
  
  <p>Thanks</p>