title: Preventing a Certain Text to be Deleted or Change in a RichTextBox
body: <p>i have RichTextBox which has a certain default text to load everytime the Form Load .</p>
  
  <p>this text for example:</p>
  
  <pre><code>// Do not Exclude this line below
  </code></pre>
  
  <p>i can add text in newline and delete if necessary but must not this line .</p>
  
  <p>like if i delete "e" in word "below" it must comeback to word "below" . same adding space or char .</p>
  
  <p>i started out this code in Keydown Event:</p>
  
  <pre><code>Regex donotexclude = new Regex(@"//\s+\s+\s+\s+\s+\s+Do\s+not\s+exclude\s+line\s+below");
              MatchCollection donotexcluDE = donotexclude.Matches(rtb_JS.Text);
  
              // if (Keys.Space &amp;&amp; 
  
              foreach (Match DONOTEXCLUDE in donotexcluDE)
              {
  
                  if (DONOTEXCLUDE.Success)
                  {
                      var donot = DONOTEXCLUDE.Groups[0].Value.ToString();
  
                      //if (!donot.Length =&gt;
                      //{
  
                      //}
                  }
                  else
                  {
  
                  }
              }
  </code></pre>
  
  <p>but I dunno what code should I add or if Im doing a wrong thing in the 1st place .</p>
  
  <p>Now my question was "How can I protect a certain text in a RichTextBox from deleting or changing" .</p>
  
  <p>Thanks and More Power!</p>