title: Batch rename files with regex
body: <p>I have a number of files with the following format:</p>
  
  <blockquote>
    <p><em>name</em>_<em>name&lt;number&gt;&lt;number&gt;</em>[TIF&lt;11 numbers&gt;].jpg</p>
  </blockquote>
  
  <p>e.g. <code>john_sam01 [TIF 15355474840].jpg</code></p>
  
  <p>And I would like to remove the <code>[TIF 15355474840]</code> from all of these files
  This includes a leading space before the <em>'[TIF...'</em> and a different combination of 11 numbers each time.</p>
  
  <p>So the previous example would become:
  <code>josh_sam01.jpg</code></p>
  
  <hr>
  
  <p>In short, using powershell (or cmd.exe) with regex I would like to turn this filename:</p>
  
  <blockquote>
    <p>josh_sam01 [TIF 15355474840].jpg</p>
  </blockquote>
  
  <p>Into this:</p>
  
  <blockquote>
    <p>josh_sam01.jpg</p>
  </blockquote>
  
  <p>With variables being: 'john' 'sam' two numbers and the numbers after TIF.</p>