Regex usage in Eclipse

Count lines of Code

eclipse_count_line

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s