---
title: "eclipse+正则+替换"
author: "qing_gee"
date: "2014-10-29T11:13:20Z"
tags: []
categories: ["行业应用"]
slug: "eclipse"
draft: false
lastmod: "2014-10-29T11:13:20Z"
id: 2149142
url: "https://qing-gee.iteye.com/blog/2149142"
---

**前言**：今天在写改代码的过程中，代码中有许多的多余注释，需要替换掉，刚开始的时候一个个删除，后来实在太痛苦，突然想到了使用正则替换，下面就说一下如何使用eclipse替换

 

1.使用ctrl+f打开替换或者查找窗口，选中Regular expressions正则模式

2.我的文件中有很多

```
	/*     */public String getEmail()
	/*     */{
		/* 269 */return this.email;
```

3.使用以下模式进行替换，正则我就不多介绍了，大家都知道\\s是空白\\d是数字，\*是匹配零个或多个  
![](http://dl2.iteye.com/upload/attachment/0102/5924/83387052-97e0-34e6-9e98-8d2d546597a4.png)  
 

最后替换就行了