Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Remove span and strong tag from string

Code Block
languagejs
let re = /(<\s*strong[^>]*>)|(<\s*\/\s*strong>)|(<\s*span[^>]*>)|(<\s*\/\s*span>)/g

let str = 'Hello <p>my</p> name <strong>is</strong>, <span style="color: rgb(17, 17, 17); font-family: &quot;Amazon Ember&quot;, Arial, sans-serif; font-size: medium;">Taskmonk</span> is a company <strong>in India. <span>how </br>are'


console.log(str.replace(re, ""))