我想使用Jon Skeet的SmartEnumerable来循环遍历Regex.Matches
,但它不起作用。
foreach (var entry in Regex.Matches("one :two", @"(?<!\w):(\w+)").AsSmartEnumerable())
请问有人可以解释一下这个问题吗?并提供一个解决方案使之可以工作。谢谢。
错误信息如下:
'System.Text.RegularExpressions.MatchCollection' does not contain a definition
for 'AsSmartEnumerable' and no extension method 'AsSmartEnumerable' accepting
a first argument of type 'System.Text.RegularExpressions.MatchCollection' could
be found (are you missing a using directive or an assembly reference?)
using System.Linq
指令。 - Ani