title: Need help tweaking regex for filenames with dimensions
body: <p>I have a lot of movies in directories with filenames containing their dimensions.</p>
  
  <ol>
  <li>descriptor-800x600.mov  </li>
  <li>cool_animation-720p.mp4</li>
  <li>reactor-1080p.mov</li>
  <li>test-640x480.mov  </li>
  </ol>
  
  <p>I'm looking to pull out the 800, 600 from #1. 720 from #2, 1080 from #3, etc.</p>
  
  <p>Looking for some help to tweak what I've got so far:</p>
  
  <pre><code>$re = '/^(.*?)\-(\d{3,4})p+|(\d{2,4})x(\d{2,4})+\.mov|mp4$/';
  preg_match($re, $filename ,$matches);
  </code></pre>
  
  <p>Matches for #1: (Getting some extra stuff I don't need...?)</p>
  
  <pre><code>Array
  (
      [0] =&gt; 800x600.mov
      [1] =&gt; {empty_string}
      [2] =&gt; {empty_string}
      [3] =&gt; 800
      [4] =&gt; 600
  )
  </code></pre>
  
  <p>Matches for #2:</p>
  
  <pre><code>Array
  (
      [0] =&gt; testing-720p
      [1] =&gt; testing
      [2] =&gt; 720
  )
  </code></pre>
  
  <p>I've obviously got something wrong, any input would be greatly appreciated!</p>