title: C# Get substring with specific pattern from string
body: <p>I have a list of strings like this:</p>
  
  <pre><code>List&lt;string&gt; list = new List&lt;string&gt;();
  list.Add("Item 1: #item1#");
  list.Add("Item 2: #item2#");
  list.Add("Item 3: #item3#");
  </code></pre>
  
  <p>How can I get and add the substrings #item1#, #item2# etc into a new list?</p>
  
  <p>I am only able to get the complete string if it contains a "#" by doing this:</p>
  
  <pre><code>foreach (var item in list)
  {
      if(item.Contains("#"))
      {
          //Add item to new list
      }
  }
  </code></pre>