Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要一个匹配包含.function_call的所有行的替换表达式,并用空行替换这些行
但是,如果该行中有=,则什么也不做。例如 int i = .function_call应该不做调整。
我对正则表达式没有经验。
在 Visual Studio -> 编辑 -> 查找和替换 -> 在文件中替换
找什么:^[^=]*\.function_call.*$
^[^=]*\.function_call.*$
将该Replace with框留空,并确保选中该Use框并选择正则表达式。
Replace with
Use
您可以尝试将其用作模式:
^[\s\S-[=]]*\.function_call.*$
并将其替换为\n.
\n