title: Replace all occurrences and regular expression
body: <p>I'm trying replace two consecutive line breaks with the HTML tag <code>&lt;p/&gt;</code>. So in a string such as:</p>
  
  <pre><code>\r\n\r\n\r\n
  </code></pre>
  
  <p>There are two consecutive occurrences of <code>\r\n\r\n</code>, </p>
  
  <p>The result should be:</p>
  
  <pre><code>&lt;p/&gt;&lt;p/&gt;
  </code></pre>
  
  <p>but with C# <code>String.Replace</code>, it only detects the first occurrence and I just get back:</p>
  
  <pre><code>&lt;p/&gt;\r\n
  </code></pre>
  
  <p>So I'm wondering if any regular expression gurus know how to detect that using regular expression?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I figured the question is a bit confusing. Let me rephrase it. The requirement should be to replace any <code>"\r\n"</code> with a tag <code>&lt;p/&gt;</code> only if there is another "\r\n" immediately before it. </p>
  
  <p>Such with the string:</p>
  
  <pre><code>\r\n\r\n\r\n
  </code></pre>
  
  <ul>
  <li>The first <code>\r\n</code>, does not have another <code>\r\n</code> before it, nothing should be done,</li>
  <li>The second <code>\r\n</code>, it does have another <code>\r\n</code> before it, qualifies for replacement,</li>
  <li>The third <code>\r\n</code>, it does have another <code>\r\n</code> before it, also qualifies for replace. </li>
  </ul>
  
  <p>So the result should be:</p>
  
  <pre><code>&lt;p/&gt;&lt;p/&gt;
  </code></pre>