Remove span and strong tag from string
Code Block | ||
---|---|---|
| ||
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: "Amazon Ember", Arial, sans-serif; font-size: medium;">Taskmonk</span> is a company <strong>in India. <span>how </br>are' console.log(str.replace(re, "")) |