Eclipse Find / replace regular expression with comment lines

I have several classes containing comments like:

...
...
...
/*     */ 
/*     */   public void startApplication()
/*     */   {
/*  57 */     initializeFields();
/*  58 */     this.run = true;
/*  59 */     new Thread(this).start();
/*     */   }
/*     */ 
/*     */   public void stopApplication() {
/*  63 */     this.run = false;
/*     */   }
/*     */ 
/*     */   public void run()
/*     */   {
...
...
...

And I need to clear all the lines /* */in my classes. What regular expression should I use for this with the Eclipse Find / Replace tool?

+3
source share
3 answers

This is a JD-GUI, I already need the same regular expression :)

/\*.*?\*/
+7
source

Hit CTRL+SPACEin the text boxes he will give you suggestions for regular expressions. Learn more about this at.

+1
source

You can use:, /\*\s+\d*\s+\*/or if you also want to remove the space before the code, assuming it's a tab, use /\*\s+\d*\s+\*/\t. It is not necessary to change this last tab for a certain number of spaces - if you just use it \s+, for example, it will lose your indent that you do not need!

0
source

All Articles