I'm trying to remove all style rules like this <style>blablabla</style> including <style> tag.
I'm using the following script to accomplish this
var text = '< style type= "text/css" > hello1 < / sTyle >
some text
< style type= "text/css" > hello2 < / sTyle >';
var regX = /< *style .*>([\s\S]*?)< *\/ *style *>/ig;
text.replace(regX, "");
but it removes the whole text including "some text" between two style definitions. I want to keep "some text" in this example.