title: Finding functions within code using Regex python
body: <p>I am trying to extract all the functions I have in a file using REGEX.
  Here's a standard file example:</p>
  
  <pre><code>int main()
  {
      printf("hello to all the good people");
      printf("hello to all the good people %d ", GetLastError());
  
      for(int i =0; i&lt;15; i++)
      {
          if(i == 5)
          {
              switch(i)
              {
                  case 0:
                      break; 
              }
          }
      }
  }
  </code></pre>
  
  <p>In the meantime, I have only succeeded in capturing functions using the following REGEX:</p>
  
  <pre><code>regex = re.findall('\w+\s*?[(].*[)]', _content) #'\w+\s*?[(]*[)]'
  for i in regex:
      print i
  </code></pre>
  
  <p>My problems are:</p>
  
  <ol>
  <li>How can I tell him to ignore things like FOR or SWITCH?</li>
  <li>How do I tell him to find an internal function inside an externally as an example:</li>
  </ol>
  
  <p><code>printf ("%s", get_string());</code></p>
  
  <ol start="3">
  <li><p>How do I make it not to relate to <code>()</code> that are between quotes as <code>()</code> that aren't between quotes (so if i have line:
  <code>printf("hello to j. (and rona) %s", get_family_name());</code>
  he will know to extract:</p>
  
  <p><code>foo name:                      parameters:
  printf                          "hello to j. (and rona) %s", get_family_name()
  get_family_name                 none</code></p></li>
  </ol>