title: Parsing #regions within Code Files
body: <p>I'm trying to create a C# program that extracts the code contained within #region tags in *.cs files.  I more or less just want to be able to anotate the code I'm working on and have it be accessible to this other program as just text.</p>
  
  <p>Is there something that already exists that accomplishes this?</p>
  
  <p>Say I have code like this:</p>
  
  <pre><code>#region ClassName.Test()
  public static void Test()
  {
       //Some method that does stuff
  }
  #endregion
  </code></pre>
  
  <p>I'd like to be able to extract </p>
  
  <pre><code>public static void Test()
  {
       //Some method that does stuff
  }
  </code></pre>
  
  <p>from the *.cs as a <code>string</code> when I specify that I'm looking for <code>Class.Test()</code>.</p>