I get matches from the string in the regular

var lst2 = Regex.Matches(data.ToString(), "(?<=class=\"row list-item)[\\W\\w]*?class=\"date") .Cast<Match>() .Select(x => Regex.Match(x.Value, "(?<=a href=\").+?(?=\")").Value) .ToList(); 

I also have a Dictionary<string, List<string>()

  var lst1 = dic[dic.Keys.ElementAt(index)]; 

I want to remove the same elements

  var rez = lst1.Distinct(ls2) 

and I get an error

 Ошибка CS1503 Аргумент 2: не удается преобразовать из "System.Collections.Generic.List<string>" в "System.Collections.Generic.IEqualityComparer<string>". 

    1 answer 1

    The Distinct method does not do what you think; it removes duplicates from one set. (And he needs a comparator in order to understand which elements are equal.)

    If you want to remove lst1 elements from lst2 , try lst1.Except(lst2) .