EDIT: I think you forgot to insert the call .AsSmartEnumerable()into your sample code. The reason that will not compile is because the extension method only works on IEnumerable<T>, and not on, a non-generic interface IEnumerable.
, ; , entry object, MatchCollection IEnumerable<T> , IEnumerable.
, IEnumerable<T>, :
foreach (var entry in Regex.Matches("one :two", @"(?<!\w):(\w+)").Cast<Match>())
{
...
}
, ( ):
foreach (Match entry in Regex.Matches("one :two", @"(?<!\w):(\w+)"))
{
...
}
smart-enumerable - -:
var smartEnumerable = Regex.Matches("one :two", @"(?<!\w):(\w+)")
.Cast<Match>()
.AsSmartEnumerable();
foreach(var smartEntry in smartEnumerable)
{
...
}
using MiscUtil.Collections.Extensions; .