title: Python search / extract string before and after a character
body: <p>Need help in extracting string before and after a character using regex in python</p>
  
  <pre><code>string = "My City | August 5"
  </code></pre>
  
  <p>I would like to extract <code>"My City"</code> and extract <code>"August 5"</code></p>
  
  <pre><code>string1 = "My City"
  string2 = "August 5"
  </code></pre>