title: regex for parsing variable names
body: <p>I am trying to get the variable names and store it in a list, but I am having trouble with coming up the regex.  So, I have a file with lines like below:</p>
  
  <pre><code>float func(float a, float b, float c)
  {
     float i, j,           k;
     float2 w;
  }
  </code></pre>
  
  <p>and what I would like to do is to get the name of the function along with the parameters var and local var.  So, I want my regex to return <code>func</code> <code>a</code> <code>b</code> <code>c</code> <code>i</code> <code>j</code> <code>k</code> <code>w</code></p>
  
  <p>and my current regex is <code>\bfloat*\d* +\w*\b</code> </p>
  
  <p>which finds <code>float func</code> <code>float a</code> <code>float b</code> <code>float c</code> <code>float i</code> <code>float w</code>.  I am not sure how to separate the float part and only take the var name with regex (I suppose I can use capture groups) but I'm not sure what to do when there are multiple var names on the same line.  Also, I'm only interested in variables that are of float types.  Any tip would be helpful.</p>
  
  <p><strong>EDITED</strong>
  I just came up with this regex <code>\bfloat*\d* +\w*[ *,* *\w]*\b</code>, which matches what I need but can I get the names in groups with just a single regex?</p>