在Eclipse中使用RegEx


Eclipse中的regular expression语法

http://www.eclipse.org/tptp/home/downloads/installguide/gla_42/ref/rregexp.html


使用grouped的RegEx替换

有如下text:
new String("abc");
new String("123");
new String("JKL");

使用这个regex: new\sString\(\"(.*)\"\) 进行match, 然后再替换为:\"$1\" 就可以一次完成 new String 的去除。

评论

此博客中的热门博文

Nu förbjuder Kina handel med elfenben

Fader av pingyins

Kineserna vill köpa Volvos kompetens