1
I'm trying to remove entire tag with specific class:
Code:
<div>
Blah blah
<div class='myClass'>
<div>some other div</div>
</div>
</div>
<div>
Blah blah
<div class='myClass'>
more text
</div>
</div>
<div>
Blah blah
<div class='myClass'>
more text
</div>
</div>
I want to search for .myClass tag and replace it with "" (delete)
so the Result is:
<div>
Blah blah
</div>
<div>
Blah blah
</div>
<div>
Blah blah
</div>
I know it's easy with jQuery but I want to do it on the text editor side. Or maybe I can just view code and copy it after jquery has deleted it. Sublime Text or Notepad++
Thanks!
Works great on one line. I failed to propery simplify the example. Sorry. I've edited it so the closing </div> is on a different line. – Miro – 2013-07-22T19:38:20.790
Your last edit gave me some headache. Nested
<div>
tags are a problem for my RegEx method. – nixda – 2013-07-22T21:13:38.980Sorry abou that :) You went above and beyond! I really think text editors should have a function or plugin for selecting html tags and classes (non-RegEx based :) ). – Miro – 2013-07-22T21:24:23.623
For a single operation, there is a notepad++ plugin called HTML tag. Here is a example picture. This only helps to identify a closing tag. Nothing more, sorry.
– nixda – 2013-07-22T22:36:53.827