title: Batch script to match two filenames in the same folder with different extension
body: <p>I've been looking, but I don't quite understand the regex of matching filenames. I have seen in SO that there are questions that match two filenames in different folders, but I'm looking within the same folder.</p>
  
  <pre><code>file01.jpg
  file01.wav
  file02.jpg
  file03.jpg
  file04.jpg
  file04.wav
  </code></pre>
  
  <p>I want it to match if there is a <code>jpg</code> and a <code>wav</code> to run a ffmpeg script, and if the <code>wav</code> doesn't have a matching <code>jpg</code> then run another ffmpeg script, and if there is no matching <code>wav</code> to the <code>jpg</code> do another script.</p>
  
  <pre><code>if( $jpg == $wav ) // matching filenames without extension
      do script1
  else if( $jpg != $wav ) // if there is no matching jpg to wav
      if( empty($jpg) &amp;&amp; $wav )
          do script2
      if( empty($wav) &amp;&amp; $jpg )
          do script3
  </code></pre>