Sublime Forum

Find and Delete Comments

#1

How do I find all comments regardless of what’s contained between them?

For example:

section.news h2 { color: #861D40; font-size: 2.4em; /* 24 / 10 */ width: 95.3064%; /* 900 / 1000 */ margin: 0 auto 9px auto; }

How do I target both “/* 24 / 10 * /” and “/* 900 / 1000 */” so that I could delete them?

Thanks!

0 Likes

#2

You can use regular expressions. Bring up the Find panel and toggle on the “Regular expressions” option (Alt+R).

This will match your examples: /\*.*\*/
This will also match multi-line comments (though I didn’t test too much so be careful): /\*.*\*/|/\*\w\W]*\*/

0 Likes