在 Notepad++ 中查找并替换匹配行首和行尾的内容

Ale*_*ees 2 regex notepad++

我想找到遵循此格式的所有行:

type="file_one_id"
type="file_two_id"
type="file_three_id"
Run Code Online (Sandbox Code Playgroud)

并将它们替换为单个替换行:

type="my_generic_replacement"
Run Code Online (Sandbox Code Playgroud)

问题是还有许多其他行也以 开头type="file_或结尾,因此我认为需要_id"搜索以 开头type="file_ 结尾的行。_id"有没有办法用notepad++来做到这一点?

Seb*_*ske 5

您可以搜索^type="file_.*_id"$(使用正则表达式)并替换为type="my_generic_replacement"