我的代码中很多地方都有以下几行。我想一次找到所有这些并用新评论替换每个这样的 block 。但是我一次只能搜索一行。但我不知道如何在我的正则表达式中包含新行以进行搜索,请帮忙。
// Block Solver
// We develop a block solver that includes the joint limit.
// when the mass has poor distribution (leading to large torques about..
//
提前致谢
最佳答案
搜索:
^(?://.*\n?)+
然后全部替换为空。
这将找到所有以 //
开头的行。
关于objective-c - Xcode 使用正则表达式查找多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14522693/