在C#中,可以使用Regex.Match方法来进行最小匹配的正则表达式搜索。该方法返回第一个匹配项,而不是所有匹配项。可以使用“?”来指定最小匹配,例如: ```csharp string input = "aabab"; string pattern = "a.+?b"; // 最小匹配 Match match = Regex.Match(input, pattern); if (match.Success) { Console.WriteLine("Match found: " + match.Value); } else { Console.WriteLine("Match not found"); } ``` 在上面的示例中,正则表达式“a.+?b”将匹配最少的字符,即第一个“a”和第一个“b”之间的字符。输出将是“Match found: aab”。