title: MySQL GROUP by Regex?
body: <p>I have the following query</p>
  
  <pre><code>SELECT Count(*) as Total_Count, Col1 
  FROM Table1 
  GROUP BY Col1 
  ORDER BY Total_Count DESC;
  </code></pre>
  
  <p>I want to zoom in on Col1. The data in Col1 are in the following format:</p>
  
  <pre><code>text-abc1
  txt4-abcde22
  tex6-abc2
  text4-imp4
  text-efg1
  txt-efg43
  </code></pre>
  
  <p>I want to be able to group it by</p>
  
  <pre><code>After the first `-`, any first three/four/five characters match
  </code></pre>
  
  <p>In this example, if we match with first 3 characters. Output will be:</p>
  
  <pre><code>Total_Count   Col1
  3             abc
  1             imp
  2             efg
  </code></pre>
  
  <p>Any other way to achieve this?</p>