使用区分大小写的 Replace 在 IntelliJ 中查找文本
Find text in IntelliJ with case sensitive Replace
我有一个测试 class 有很多自动生成的方法,像这样:
public void testInitBinder() throws Exception { }
public void testGetAllMetaLabelTbls() throws Exception { }
public void testList() throws Exception { }
public void testEdit() throws Exception { }
我想删除方法名称中的 "test" 一词,然后让方法名称正确地以小写开头。例如 testInitBinder
会变成 initBinder
.
请注意,这只是一个示例。我想知道如何在这种特定情况之外的其他情况下执行这种类型的 find/replace 。 (告诉我如何在没有前缀 "test" 的情况下自动生成不会回答这个问题。)
我的本地问题
你可以使用 search and replace, select 你想使用正则表达式并使用类似这样的 search/replacement 模式:
- 搜索模式:
void test([A-Z]{1})(.*)\(
- 替换模式:
void \L\E\(
请注意,这是一个相当粗糙的解决方案,但对于您的情况来说可能已经足够好了。
我有一个测试 class 有很多自动生成的方法,像这样:
public void testInitBinder() throws Exception { }
public void testGetAllMetaLabelTbls() throws Exception { }
public void testList() throws Exception { }
public void testEdit() throws Exception { }
我想删除方法名称中的 "test" 一词,然后让方法名称正确地以小写开头。例如 testInitBinder
会变成 initBinder
.
请注意,这只是一个示例。我想知道如何在这种特定情况之外的其他情况下执行这种类型的 find/replace 。 (告诉我如何在没有前缀 "test" 的情况下自动生成不会回答这个问题。)
我的本地问题
你可以使用 search and replace, select 你想使用正则表达式并使用类似这样的 search/replacement 模式:
- 搜索模式:
void test([A-Z]{1})(.*)\(
- 替换模式:
void \L\E\(
请注意,这是一个相当粗糙的解决方案,但对于您的情况来说可能已经足够好了。