Sublime Forum

Cleaning old HTML Code with Sublime and RegEx?

#1

Hi @all,
In the past i had operated >88 different HTML sides within my 3300 html Sides. In the last couple of months i lift up those 3300 Websides to an standard. They have all the same number of lines and so on, a standardization . But now there are still 1526 old “Sins” that I want to move. The opening tag to uncomment a Textblock looks exactly like that <!-- #####

and to make matters worse, these appear at the end of 7 different line numbers
.html:257: ==> 657 times
.html:64: ==> 536 times
.html:261: ==> 96 times
.html:273: ==> 73 times
.html:249: ==> 82 times
.html:318: ==> 47 times
.html:265: ==> 35 times

So i can’t only replace because i want to have the uncomment <!-- at the beginning of the next Line.
Example from a HTML-Side (Line 257):
<a class="thumbnail" href="#thumb"><img src="../../../bilder/piat/crazycars_piast86/thumbs/t_crazycars_piast86_8d.png" height="65" title=""/><span><img src="../../../bilder/piat/crazycars_piast86/crazycars_piast86_8d.png"/><br>8D</span></a><!-- #####<br>

After the correction it has to look like that:
[257]<a class="thumbnail" href="#thumb"><img src="../../../bilder/piat/crazycars_piast86/thumbs/t_crazycars_piast86_8d.png" height="65" title=""/><span><img src="../../../bilder/piat/crazycars_piast86/crazycars_piast86_8d.png"/><br>8D</span></a>
[258]<!-- <a class="thumbnail" href="#thumb"><img src="../../../bilder/piat/crazycars_piast86/thumbs/t_crazycars_piast86_9a.png" height="65" title=""/><span><img src="../../../bilder/piat/crazycars_piast86/crazycars_piast86_9a.png"/><br>9a</span></a>

Now my understanding from RegEx is realy poor, so that I have to rely on outside help to complete the last part of my cleanup.
I hope i’ve discribed the problem correct for your understanding. Is there a possibilty to fix that with Sublime Text 3?

regards from Germany and happy Easter

Andreas

0 Likes