关于“xml文件注释掉多行” 的推荐: 如何实现多行注释块 ".*"是a)贪婪,b)在行尾上绊倒。 Use Regex lineRgx = new Regex(Regex.Escape(rule.LineStart) + "(?s).*?(?-s)" + Regex.Escape(rule.LineStart)); 不需要添加额外的选项。 EXPLANATION ---(?s) enable . to match line ending charact...