title: Javascript Regex Replace HTML Tags
body: <p>Having a lot of difficulties using regex.</p>
  
  <p>Heres what i am trying to do...</p>
  
  <pre><code>text&lt;div&gt; text &lt;/div&gt;&lt;div&gt; text &lt;/div&gt;&lt;div&gt; text &lt;/div&gt;
  </code></pre>
  
  <p>to turn it in to</p>
  
  <pre><code>text&lt;br&gt; text&lt;br&gt;text&lt;br&gt;text
  </code></pre>
  
  <p>I've tryed doing...</p>
  
  <pre><code>newhtml = newhtml.replace(/\&lt;div&gt;/g,'&lt;br&gt;');
  newhtml = newhtml.replace(/\&lt;/div&gt;/g,' ');
  </code></pre>
  
  <p>but this gives the wrong output. Does jquery provide a better way of doing this?</p>