Regex usage in Eclipse

Count lines of Code


This regex counts all lines with at least one character.


Delete all single line comments

regular expression //[^\n]*\R (ctrl+f and replace this to nothing)
\R – line separator
\t – tab

* If you are editing JSON files in Eclipse, then it can not contain enters(line separators) or tabs, you have to use \n or \t or html char code to replace them. Otherwise, your JSON file won’t work.
** to know char code that eclipse is using, select the stuff you want to know, then press ctrl+f. e.g. select 2 lines to find out what the line separator looks like.