title: Check if two strings contain the same pattern in python
body: <p>I have the following list:</p>
  
  <pre><code>names = ['s06_215','s06_235b','s06_235','s08_014','18:s08_014','s08_056','s08_169']
  </code></pre>
  
  <p><code>s06_235b</code> and <code>s06_235</code>, <code>s08_014</code> and <code>18:s08_014</code> are duplicated. However, as shown in the example, there is no specific pattern in the naming. I need to do a pairwise comparison of the element of the list:</p>
  
  <pre><code>for i in range(0, len(names)-1):
      for index, value in enumerate(names):
          print names[i], names[index]
  </code></pre>
  
  <p>I need then to check for each pair, if the two, contain the same string but with length more than <code>4</code>. That is <code>s06_235b</code> and <code>s06_235</code>, and <code>s08_014</code> and <code>18:s08_014</code> would pass this criterion but <code>s08_056</code> and <code>s08_169</code> would not. </p>
  
  <p>How can I achieve this in Python?</p>