title: VBA Regex Patterns for Date Coding Documents
body: <p>I've started working at a new job, which it turns out has a giant pile of completely unorganized, non-standardized file names across a pile of directories (too many to do manually). Initially my plan was to use a simple VBA script to use string compare of the first 13 characters, then if they don't match, place a string with the ideal date format (utilising the date created of the document) at the front, but then I noticed several patterns already exist and by doing my original plan I would just be creating another problem in the future (by having incorrect date codes behind my ideal string). Therefor after research I realised Regex patterns should be the way to go.</p>
  
  <p>My ideal starting format is this:
  "yyyy.mm.dd - " (ie. "2014.11.20 - " I tried creating my first expression to match this but have had no luck so far:</p>
  
  <pre><code>^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
  </code></pre>
  
  <p>Can someone please tell me where I am going wrong? My search through online tutorials has left me more confused than when I started.</p>
  
  <p>The plan from there is to match other common date formats (below) in the directories and replace them with the "ideal", any help with regex patterns that would identify them would be greatly appreciated.</p>
  
  <p>"yymmdd "
  "yyyy mm dd - "
  "yyyymmdd "
  "yyyymmdd - "</p>
  
  <p>My plan would be to use a simple IF vba function, finding which the name matches to and doing the neccessary VBA strings manipulations to create the correct, standard format.</p>
  
  <p><em>For example if the current name of the file is this "141003 xxxxxx" it would be replaced with "2014.10.03 - xxxxx", etc.</em></p>
  
  <p>Thanks very much for your help in advance.</p>