title: Use regular expression in group_by
body: <p>I have data:</p>
  
  <pre><code>data = [["/","201408","41"],["/","201409","35"],["/","201410","59"],["/","201411","50"],["/","201412","79"],["/","201501","97"],["/","201502","85"],["/","201503","518"],["/","201504","251"],["/","201505","748"],["/","201506","916"],["/","201507","1008"],["/","201508","449"],["/","201509","235"],["/","201510","195"],["/","201511","229"],["/","201512","202"],["/","201601","142"],["/","201602","134"],["/","201603","17"]]
  </code></pre>
  
  <p>I want to group them by year, but I don't know how I can use a regex in <code>group_by</code>. I should look like this:</p>
  
  <pre><code>grouped = data.group_by { |row| row[1] }
  </code></pre>
  
  <p>but what's next? row[1] string is YYYYMM</p>