eclipse使用技巧---使用正規表示式查詢替換

Franson發表於2016-07-13
1,Eclipse ctrl+f 開啟查詢框
2,選中 Regular expressions (正規表示式)

去掉/* */(eclipse)        /\*(.|[\r\n])*?\*/
去掉//(eclipse)             //.*$
去掉import(eclipse)     import.*$
去掉空行(eclipse)         ^\s*\n
去掉空行(ue)               %[ ^t]++^p
 
 
把 <html.*property=/"([a-zA-Z/_]+)/".*/>
替換成 <c:out value=/"/$/{af.map.$1/}/" />
 
 
^hello 以hello為開頭
hello$ 以hello為結尾
 
 
匹配以   </title> 結尾的字串: 
.*? </title> 

匹配以   <title> 開頭的字串: 
<title> .* 

匹配以   <title> 開頭 </title> 結尾的字串: 
<title> .*? </title> 

相關文章