title: Regex is matching second occurence. I need it to match first occurence
body: <p>This is my regex code:</p>
  
  <pre><code>.*(X.*)\s(.*?)\$
  </code></pre>
  
  <p>This is my data string:</p>
  
  <pre><code>1247.P1.06.Z01.0020N.X396X111.Y008 1247.P1.06.Z01.0020N$M234477$
  </code></pre>
  
  <p>This is properly grabbing the second item that ends with the first $ sign:</p>
  
  <pre><code>1247.P1.06.Z01.0020N
  </code></pre>
  
  <p>But for the first string, I want it to grab:</p>
  
  <pre><code>X396X111.Y008
  </code></pre>
  
  <p>Instead it is grabbing:</p>
  
  <pre><code>X111.Y008
  </code></pre>
  
  <p>So I want it to get the first <code>X</code> and everything up to the space.  But the second <code>X</code> is triggering the match. </p>
  
  <p>The string starting with "X" is always 13 characters, so I tried specifying the length but it still started with the second X</p>
  
  <p>I am fine with either pattern:</p>
  
  <ul>
  <li>Start with the first X and end with the space.  </li>
  <li>Start with the first X and grab 13 characters. </li>
  </ul>
  
  <p>Thank you.  </p>