title: regex to remove everything after a certain character (comment)
body: <p>I have a regex which I am using to remove everything after a specific character, semi-colon.</p>
  
  <pre><code>        var regex = new Regex(@";(.*)", RegexOptions.Singleline);
          tb.Text = regex.Replace(tb.Text, "");
  </code></pre>
  
  <p>It seems to work fine, but at times it removes the entire text of the text box. For example all of this code is removed:</p>
  
  <pre><code>;fgkdfgdfgd
  ;dfgdfkghdfgdf
  ;sdgfsdfsdfsdf
  ;dfgdfgdfg
  
  #dont remove this          ;fgdfgdfg
  </code></pre>
  
  <p>the "#dont remove this" should stay intact because it isn't after the semi-colon, but it doesn't? Is something wrong with my regex?</p>
  
  <p>The idea is to remove or trim all comments from a file.</p>