title: Replace last occurrence of at least double new line (\n\n) in string PHP
body: <p>I need to replace <strong>last occurrence</strong> of at least double new line (<strong>\n\n</strong>) in a string, so it should be <strong>\n\n</strong> or <strong>\n\n\n</strong> or <strong>\n\n\n\n</strong> an so on (<strong>at least 2 \n</strong>) by the "<strong>@@</strong>". I think that it should be <strong>preg_replace</strong>. I have tried many option that is in the answers here on <em>stackoverflow</em>, but all this options have some cases that was not catched. I tried regex101 site to prepare regular expression, but I am not strong in this, so I found some solution that looks like working on the site (<code>/((\\n){2,})+(?!.*((\\n){2,})+)/i</code>), but when I am trying it in my code, i doesn't work.</p>
  
  <p>Another one was <code>([\\n\\n])+(.[^\\n\\n])*$</code>, but this one catched also last <strong>nn</strong></p>
  
  <p>The test string was:</p>
  
  <blockquote>
    <p>Storage\nThe powerful quad-core Intel X5 processor in Transformer Book T101HA means you'll have no problem breezing through all your everyday tasks,\nwith seamless multitasking allowing you to get more done in less time. Storage is conveniently flexible, too. Inside, there's 128GB of super-fast flash storage, and it's easily expandable via the micro SD card slot. You also get you a year's free unlimited cloud storage on ASUS WebStorage!\n\nColor|White/Gold\n\n\n\n\n\nCPU|Innn dsafdsfdfa <strong>\n\n\n\n\n\n\n\n</strong> dfnn</p>
  </blockquote>
  
  <p>So the result should be:</p>
  
  <blockquote>
    <p>Storage\nThe powerful quad-core Intel X5 processor in Transformer Book T101HA means you'll have no problem breezing through all your everyday tasks,\nwith seamless multitasking allowing you to get more done in less time. Storage is conveniently flexible, too. Inside, there's 128GB of super-fast flash storage, and it's easily expandable via the micro SD card slot. You also get you a year's free unlimited cloud storage on ASUS WebStorage!\n\nColor|White/Gold\n\n\n\n\n\nCPU|Innn dsafdsfdfa <strong>@@</strong> dfnn</p>
  </blockquote>
  
  <p>Can anyone help with this and maybe in addition explain the logic of the answered regex.</p>
  
  <p>Thanks a lot.</p>