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

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -