title: filtering columns by regex in dataframe
body: <p>I have a large dataframe (3000+ columns) and I am trying to get a list of all column names that follow this pattern:</p>
  <pre><code>&quot;stat.mineBlock.minecraft.123456stone&quot;
  &quot;stat.mineBlock.minecraft.DFHFFBSBstone2&quot;
  &quot;stat.mineBlock.minecraft.AAAstoneAAAA&quot;
  </code></pre>
  <p>My code:</p>
  <pre><code>stoneCombined&lt;-grep(&quot;^[stat.mineBlock.minecraft.][a-zA-Z0-9]*?[stone][a-zA-Z0-9]*?&quot;, colnames(ingame), ignore.case =T)
  </code></pre>
  <p>where ingame is the dataframe I am searching. My code returns a list of numbers however instead of the dataframe columns (like those above) that I was expecting. Con someone tell me why?</p>
  <p><strong>After adding <code>value=TRUE</code> (Thanks to user227710):</strong></p>
  <p>I now get column names, but I get every column in my dataset not those that contain : <code>stat.mineBlock.minecraft.</code> and <code>stone</code> like I was trying to get.</p>