title: Pattern matching and placeholder values
body: <p>I'm writing an application that uses renaming rules to rename a list of files based on information given by the user.  The files may be inconsistently named to begin with, or the filenames may be consistent.  The user selects a list of files, and inputs information about the files (for MP3s, they would be Artist, Title, Album, etc).  Using a rename rule (example below), the program uses the user-inputted information to rename the files accordingly.</p>
  
  <p>However, if all or some the files are named consistently, I would like to allow the program to 'guess' the file information.  That is the problem I'm having.  What is the best way to do this?</p>
  
  <p>Sample filenames:</p>
  
  <pre><code>Kraftwerk-Kraftwerk-01-RuckZuck.mp3
  Kraftwerk-Autobahn-01-Autobahn.mp3
  Kraftwerk-Computer World-03-Numbers.mp3
  </code></pre>
  
  <p>Rename Rule:</p>
  
  <pre><code>%Artist%-%Album%-%Track%-%Title%.mp3
  </code></pre>
  
  <p>The program should properly deduce the Artist, Track number, Title, and Album name.</p>
  
  <p>Again, what's the best way to do this?  I was thinking regular expressions, but I'm a bit confused.</p>