title: Regex to ignore commented lines C++
body: <p>I'm trying to use regex to find all variable initializations or assignments in code.
  Currently I have </p>
  
  <pre><code>(\w+|\w[_])\s*=\s*(\d+\.\d+|.*)
  </code></pre>
  
  <p>which works but also finds commented out code like 
  <code>// a = 100;</code> which I don't want it to do. I've tried</p>
  
  <pre><code>([^/]\w+|\w[_])\s*=\s*(\d+\.\d+|.*)`
  </code></pre>
  
  <p>which I thought should ignore strings that start with / but that doesn't work.</p>
  
  <p>Edit:</p>
  
  <p>For example I'd like it to find lines like
  <code>b = 200;</code>
  but not <code>// c = 3;</code></p>