string pattern = "#B#(.*)#E#"; result = Regex.Replace((string)result, pattern, "");
在 .* 后面加一个问号,表示不要贪婪匹配。 string pattern = "#B#(.*?)#E#"; https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/quantifiers-in-regular-expressions
110,539
社区成员
642,577
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧