title: Remove HTML tags and newline characters with Regex
body: <p>I want to replace html tags and newline characters with a <code>&lt;br&gt;</code> tag. In order to do so, I have used the following code, but it does not replace <code>\r\n</code>.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const newText = text.replace(/&lt;script.*?&lt;\/script&gt;/g, '&lt;br&gt;')
    .replace(/&lt;style.*?&lt;\/style&gt;/g, '&lt;br&gt;')
    .replace(/(&lt;([^&gt;]+)&gt;)/ig, "&lt;br&gt;")
    .replace(/(?:\r\n|\r|\n)/g, '&lt;br&gt;')</code></pre>
  </div>
  </div>
  </p>
  
  <hr>
  
  <h3>An example of the text</h3>
  
  <pre><code>&lt;div class="text-danger ng-binding" ng-bind-html="message.causedBy "&gt;javax.xml.ws.soap.SOAPFaultException: Response was of unexpected text/html ContentType.  Incoming portion of HTML stream: \r\n\r\n\r\n\r\n500 - Internal server error.\r\n\r\n\r\n\r\n&lt;div&gt;&lt;h1&gt;Server Error&lt;/h1&gt;&lt;/div&gt;\r\n&lt;div&gt;\r\n &lt;div class="\&amp;quot;content-container\&amp;quot;"&gt;\r\n  &lt;h2&gt;500 - Internal server error.&lt;/h2&gt;\r\n  &lt;h3&gt;There is a problem with the resource you are looking for, and it cannot be displayed.&lt;/h3&gt;\r\n &lt;/div&gt;\r\n&lt;/div&gt;\r\n\r\n\r\n\n\t&lt;/div&gt;
  </code></pre>
  
  <p>I appreciate if you help me. (: </p>