开发者

How to remove all inline styled `style=properties+val` from every tag from a long source code?

How to remove all inline styled开发者_StackOverflow社区 style=properties+val from every tag from a long source code quickly.

For example.

<p style="border:2px red solid">some text</p>
<span style="background:red">some text</span>

to

<p>some text</p>
<span>some text</span>


Assuming your editor supports regular expression find and replace (and if it doesn't, get a new editor):

Find with this regular expression: \s?style="[^"]*"

Replace with: nothing!

Note that this will not catch instances where your code is malformed, as shown in your example (missing double quote at the end of the first style).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜