Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Find/Replace with Regex to comment lines

I have some classes that contains comments like as follow:

...
...
...
/*     */ 
/*     */   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 have to clean all /* */ strings in my classes. Which regex should i use to do this with using Eclipse's Find/Replace tool?

like image 824
Oguz Ozkeroglu Avatar asked Oct 31 '25 13:10

Oguz Ozkeroglu


2 Answers

This is Jd-GUi, I've already needed the same regex :)

/\*.*?\*/
like image 138
Marko Topolnik Avatar answered Nov 03 '25 03:11

Marko Topolnik


Hit CTRL+SPACE on the text boxes it will give you suggestions for regular expressions. You can fin more details in this discussion

like image 40
M3HD1 Avatar answered Nov 03 '25 02:11

M3HD1