title: Regex Replace w Match
body: <p>I have names like "Western Michigan" "Northern Illinois" and I need to change them to "W Michigan" and "N Illinois".  The following is the closest I have but this fails cause let's say I match the word "Western Michigan" it throws an error and says \2 is an unmatched group (\3 seems to return the W I want).  (this is python)  </p>
  
  <pre><code>re.sub("^((S)outhern|(E)astern|(W)estern|(N)orthern)", r"\2", long_name)
  </code></pre>