title: Regular Expression: Remove Time-Stamp from File-Name
body: <p>I'm reading through a directory looking for specific file names. I'm able to remove the document tag <code>'.xml'</code> from every file name for comparison. The problem is that about 10% of them have a six digit time-stamp at the end of the title.</p>
  
  <pre><code>file_list = os.listdir(directory_address)
  
  for entry in file_list:        
          re.sub('\.xml$','', entry).upper()
  
  
  #file name examples
  
  filename_1 = 'normal_filename'
  
  filename_2= 'another_normal_filename_A23'
  
  filename_3 = 'stamped_file_name_085373'
  </code></pre>
  
  <p>My program will not know off the bat which files have a time stamp. Some of the files--lacking a time stamp--will also naturally end with one or two numbers. To my knowledge, only stamped file names will end in this format <code>_######</code>. </p>
  
  <p>How can I use <strong>regex</strong> to recognize file names with exactly six digits attached to the end <code>_######</code> and remove those digits from the string for comparision?</p>