title: Python - Removing all occurrences of a character only when it appears before non-capitalized words
body: <p>I have the following string:</p>
  
  <pre class="lang-py prettyprint-override"><code>mystring= "Foo some \n information \n Bar some \n more \n information \n Baz more \n information"
  </code></pre>
  
  <p>I would like to keep "\n" only when it precedes a word that starts with a capital letter. I would like to remove all other instances of "\n" in my sentence. </p>
  
  <p>Desired output:</p>
  
  <pre class="lang-py prettyprint-override"><code>"Foo some information \n Bar some more information \n Baz more information"
  </code></pre>
  
  <p>Is there a way to do this with re.sub? I can think of trying to split the words and use the <code>word[0].isupper()</code> argument. However, I believe there may be a way to identify Capital words with regex. </p>