title: Best way to replace sentences/paragraphs with a string in python
body: <p>How would I replace all the sentences and paragraphs with a <code>&lt;string&gt;</code> tag in text files? </p>
  
  <p>I want to keep spacing, tabs, and lists in the text document intact:</p>
  
  <p>Example input:</p>
  
  <pre><code>Clause 1:
  
    a) detail 1. some more about detail 1. Here is more information about this paragraph right here. There is more information that we think sometimes.
  
    b) detail 2. some more about detail 2. and some more..
  </code></pre>
  
  <p>Example output:</p>
  
  <pre><code>&lt;string&gt;
  
    a) &lt;string&gt;
  
    b) &lt;string&gt;
  </code></pre>