title: .Net string parsing library, or regex for parsing .Net code files
body: <p>I would like to be able to parse vb.net code files, so I can examine the collection of Subs, Functions (and their contents, including comments), private variables, etc.</p>
  
  <p>I <strong>can</strong> be open the actual source code files.</p>
  
  <p>So for example, if I have:</p>
  
  <pre><code>Public Function FunctionOne(arg1 As String, arg2 as String) as Integer
     here is some code
     ''//here are some comments
  End Function
  
  Public Sub FunctionOne(arg1 As integer, arg2 as integer)
     here is some code
     ''//here are some comments
  End Sub
  </code></pre>
  
  <p>I would like to be able to parse out all of the subs and functions and all of the code between the Public Function and End Function (actually, it would be nice to have the option to either include just the code within, or the entire function definition.</p>
  
  <p>This would seem to call for some sort of a parsing library, or else fairly decent regex skills.</p>
  
  <p>Any suggestions?</p>
  
  <p>UPDATE:
  The main thing I'm trying to achieve is the parsing of the source code, so reflection is just fine perhaps for getting the list of functions and what not and I know how to do that, but it is a proper way of <strong>parsing the source code</strong> I am trying to figure out.</p>