title: How do I append String data to certain positions using python regular expressions?
body: <p>I am working on a simple python script; I have multiple Strings that look like this:</p>
  
  <pre><code>"Some show 14x01 - the one where they do thing 1"
  
  "Some show 14x21 - the one where they do thing 2"
  
  "Some show 10x11 - the one where they do thing 3"
  </code></pre>
  
  <p>I would like to replace and append characters so that they will instead be formatted like this:</p>
  
  <pre><code>"Some show S14E01 - the one where they do thing 1"
  
  "Some show S14E21 - the one where they do thing 2"
  
  "Some show S10E11 - the one where they do thing 3"
  </code></pre>
  
  <p>So ideally I am removing replacing the x with a capital E and appending the S to the front of the String segment.</p>
  
  <p>I have figured out the regular expression to be used to identify the section to be altered, </p>
  
  <pre><code>r"\d{2}.\d{2}"
  </code></pre>
  
  <p>or </p>
  
  <pre><code>r"\d{2}\w\d{2}"
  </code></pre>
  
  <p>And have guessed this much:</p>
  
  <pre><code>for file in files:
      strFileName = str(file)
      strFileName = re.sub(r"\d{2}.\d{2}", ) # Unsure here
      strNew_name = 'Some show - ' + str(file) # Unsure here
      os.rename(file, strNew_name)
  </code></pre>
  
  <p>But I am at a loss as to how to proceed and finish this renaming process. Can someone help guide me to the answer or direct me to a SO question that has been asked that will help me to answer it please? Thank you!</p>