title: Group by similar string
body: <p>Suppose I have a table like this</p>
  
  <pre><code>| id_grupo |    nombre       |
  |:---------|----------------:|
  | 1        | Emprendedores 1 |     
  | 2        | Emprendedores 2 |    
  | 3        | Emprendedoras 1 |      
  | 4        | Emprendedoras 2 |         
  | 5        | Los amigos 1    |       
  | 6        | Los amigos 2    |
  | 7        | Los amigos no 1 |  
  </code></pre>
  
  <p>I want to group by name that are equal but <strong>ends</strong> in different number. If you look closely there are names which consists of two or more words however the difference is the ending. Also there are name which look similar but they are not the same like "Los amigos" and "Los amigos no", these belong to different groups, also "Emprendedores" and "Emprendedoras" are different.</p>
  
  <p>This is the query I have:</p>
  
  <pre><code>SELECT *, GROUP_CONCAT(id_grupo) 
  FROM creabien_sacredi_dev.grupos
  GROUP BY SUBSTRING(nombre,1,5)
  </code></pre>
  
  <p>It works fine with most of the records however the problem comes with strings like in the example which are very similar. I choose a substring with 5 characters but in fact names doesn't have the same length so some strings are not working as expected.</p>
  
  <p>How can I group these strings in the following form?</p>
  
  <pre><code>    | id_grupo |    nombre       | GROUP_CONCAT(id_grupo) |
      |:---------|----------------:|-----------------------:|
      | 1        | Emprendedores 1 |  1,2                   |    
      | 3        | Emprendedoras 1 |  3,4                   |   
      | 5        | Los amigos 1    |  5,6                   |
      | 7        | Los amigos no 1 |  7                     |
  </code></pre>
  
  <p>I think the key is on the last number the preceding string must be exactly the same, but I don't know how to do it. Could you help me please?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>There are also records like 'Emprendedores' without any number at the end and this also should be grouped with 'Emprendedores 1' and 'Emprendedores 2'. So I think the number isn't anymore the key, in fact I doubt if there exist a way to group these records.</p>