tags:

views:

46

answers:

1

How to remove all inline styled 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>
+3  A: 

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).

Jimmy Cuadra
ok . missed double quote is a typo mistake
metal-gear-solid
thx it's working
metal-gear-solid
+1 Obviously a case for regular expressions. It is amazing how many people do not have a basic grasp of regular expressions and how/when to apply them. Not bagging on the OP, just sayin... Rx should be required reading...
Sky Sanders