title: Python Regex reading in c style comments
body: <p>Im trying to find c style comments in a c file but im having trouble if there happens to be // inside of quotations. This is the file:</p>
  
  <pre><code>/*My function
  is great.*/
  int j = 0//hello world
  void foo(){
      //tricky example
      cout &lt;&lt; "This // is // not a comment\n";
  }
  </code></pre>
  
  <p>it will match with that cout. This is what i have so far (i can match the /**/ comments already)</p>
  
  <pre><code>fp = open(s)
  
  p = re.compile(r'//(.+)')
  txt = p.findall(fp.read())
  print (txt)
  </code></pre>