title: How to replace the content between two flags using regular expressions in Android?
body: <p>I set two flags for a text string, I hope to replace all the content between the flag <code>&lt;!--BeginOfReplace--&gt;</code> and the flag <code>&lt;!--EndOfReplace--&gt;</code>.</p>
  
  <p>I think the regular expressions can do it, how can I write a code in Java? Thanks!</p>
  
  <p><strong>Text String</strong> </p>
  
  <pre><code>This is a cup
  
  &lt;!--BeginOfReplace--&gt;     
  
     Hello, world !
  
  &lt;!--EndOfReplace--&gt; 
  
  I will go back. 
  </code></pre>