title: Difficulty using javascript replace function with regex for <span> and </span>...all inclusive
body: <p>How can I use <code>.replace()</code> with regex for <code>&lt;/?span&gt;</code>, as in <a href="https://stackoverflow.com/questions/7199006/regular-expression-to-match-span-or-span">this question</a>? (this regex would ideally match <code>&lt;span&gt;</code> or <code>&lt;/span&gt;</code>, including all things within the span)</p>
  
  <p>I have tried a variety of examples, such as: </p>
  
  <pre><code>.replace(/&lt;/?span&gt;/,"")
  
  .replace(/&lt;/?span&gt;/g,"")
  
  .replace(/[&lt;/?span&gt;]/,"")
  
  .replace(/[&lt;/?span&gt;]/g,"")
  </code></pre>