title: \n (New Line) is replacing whole string when I use preg_replace function
body: <p>When I try </p>
  
  <p><code>$stg = preg_replace("/&lt;PREPNAME&gt;.*&lt;\/PREP_ZIP&gt;/s","",$stg);</code> </p>
  
  <p>It properly work and it replace the text written in that function. And I get <code>$stg</code> is stripped and I get remaining string.</p>
  
  <p>But when I try with <code>"\n"</code>, it empty the complete string.</p>
  
  <pre><code>$stg = preg_replace("/&lt;PREPNAME&gt;.*&lt;\/PREP_ZIP&gt;\n/s","",$stg);
  </code></pre>
  
  <p>I get <code>$stg</code> empty in second case.</p>
  
  <p>Please help. Where I am missing ?</p>
  
  <p>Example String :-</p>
  
  <p>This is not an XML string. This is just a blob data that is stored in the database. While fetching this is just a string.</p>
  
  <pre><code>&lt;T2_NASD_LAST_NAME1&gt;ASDSADSA&lt;/T2_NASD_LAST_NAME1&gt;\r\n    
  &lt;T2_NASD_FIRST_NAME1&gt;SADASD&lt;/T2_NASD_FIRST_NAME1&gt;\r\n    
  &lt;T2_SOC1&gt;012345678&lt;/T2_SOC1&gt;\r\n     
  &lt;T2_DOBM1&gt;02&lt;/T2_DOBM1&gt;\r\n  &lt;T2_DOBD1&gt;02&lt;/T2_DOBD1&gt;\r\n     
  &lt;T2_DOBY1&gt;1984&lt;/T2_DOBY1&gt;\r\n    
  &lt;T2_NASD_LAST_NAME&gt;ASDSADSA&lt;/T2_NASD_LAST_NAME&gt;\r\n
  &lt;T2_NASD_FIRST_NAME&gt;SADASD
  &lt;/T2_NASD_FIRST_NAME&gt;\r\n
  &lt;T2_NASD_MIDDLE_NAME&gt;ASDA&lt;/T2_NASD_MIDDLE_NAME&gt;\r\n
  &lt;T2_SOC&gt;012345678&lt;/T2_SOC&gt;\r\n&lt;T2_ADR_ADRN&gt;SADSADAS&lt;/T2_ADR_ADRN&gt;\r\n
  &lt;T2_ADR_ADRA&gt;DASD&lt;/T2_ADR_ADRA&gt;\r\n&lt;T2_ADR_ADRC&gt;ASDSADSA&lt;/T2_ADR_ADRC&gt;\r\n
  &lt;T2_ADR_ADRS&gt;MI&lt;/T2_ADR_ADRS&gt;\r\n&lt;T2_ADR_ADRZ&gt;11111&lt;/T2_ADR_ADRZ&gt;\r\n
  &lt;T2_DOBM&gt;02&lt;/T2_DOBM&gt;\r\n&lt;T2_DOBD&gt;02&lt;/T2_DOBD&gt;\r\n
  &lt;T2_DOBY&gt;1984&lt;/T2_DOBY&gt;\r\n\n\n\n\n\n\n\n&lt;PREPFLAG&gt;NONE&lt;/PREPFLAG&gt;\n
  &lt;PREPNAME&gt;AAAA&lt;/PREPNAME&gt;\n
  &lt;PREPADDRESS&gt;BBBB&lt;/PREPADDRESS&gt;\n
  &lt;PREP_ZIP&gt;1984&lt;/PREP_ZIP&gt;
  </code></pre>