title: Convert regex matches to the list of strings
body: <p>I'm trying to find equal sub-string in big list about 50 000 strings, this way fine:</p>
  
  <pre><code>var results = myList.FindAll(delegate (string s) { return s.Contains(myString); });
  </code></pre>
  
  <p>but it also looks for sub-string with part of word, for example, if I'm looking for "you do" it founds also extra "you dont" because contains "you do..". </p>
  
  <p>So, <a href="https://stackoverflow.com/questions/54413996/find-equal-substring-in-list-of-strings">this answer to my previous question</a> supposedly should work as i need, but I'm not sure, how to get strings list from regex matches for particular code: </p>
  
  <pre><code>foreach (string phrase in matchWordsList)
  {
       foreach (string str in bigList)
       {
            string[] stringsToTest = new[] { phrase };
            var escapedStrings = stringsToTest.Select(s =&gt; Regex.Escape(s)); 
            var regex = new Regex("\\b(" + string.Join("|", escapedStrings) + ")\\b");
            var matches = regex.Matches(str);
  
            foreach (string result in matches) /// Incorrect: System.InvalidCastException 
            {
                resultsList.Add(result);
            }
       }
  }
  </code></pre>
  
  <p>Getting strings from <code>matches</code> directly to the <code>list</code> throws exception:</p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.InvalidCastException' occurred
    in test.exe</p>
    
    <p>Additional information: Unable to cast object of type
    'System.Text.RegularExpressions.Match' to type 'System.String'.</p>
  </blockquote>
  
  <p>So, I'm trying to figure out, hot to convert  <code>var matches = regex.Matches(str);</code> to the list</p>