Remove <style> tags globally using Regex in JavaScript -




how can use regex in javascript remove <style>, <style type="text/css">, </style>, <style type="text/css"/>. final result css without style tags.

for reason code below doesn't work.

str.replace(/<style\b[^<]*(?:(?!<\/style)<[^<]*)*<\/style>/gi,''); 

to capture inline style can use

style="(.*)" 

demo online





wiki

Comments

Popular posts from this blog

elasticsearch - what is the equivalent data type for geo_point in hibernate search? -

firebase - How to wait value in Ionic 2 -

Jenkins: find build number for git commit -