title: How do I convert Regex object to string
body: <p>I am working on c# and am grabbing only links (an example) to the downloaded html code. </p>
  
  <p>I know that I have the code of the website in the string htmlcode.</p>
  
  <p>However I can't seem to get this to allow me to put match into a string. Below is my code:</p>
  
  <pre><code> public string getURL()
      {
          /* Web client being opened up and being ready to read */
          WebClient webclient = new WebClient();
          Uri URL = new Uri("http://www.pinkbike.com");
          string htmlcode = webclient.DownloadString(URL);
          /* Time to grab only the links */
          string pattern = @"a href=""(?&lt;link&gt;.+?)""";
          Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);
          MatchCollection MC = regex.Matches(htmlcode);
          string htmlcode1;
          foreach(Match match in MC)
          {
              /* Error location */
              htmlcode1 = match.Groups["link"];
  
          }
          return htmlcode1;
  </code></pre>