How to find common sub strings in python? : <p>I am writing a python script where I have to find common substrings in many string sequences.
For example:</p>

<pre><code>sequence1 = 'mweitngaomjksjasper;36nnG1bmaso3th7a\-'
sequence2 = 'asngiqbwebs7-236jasper;u52dsv--4512G1b'
sequence3 = 'asvjaspermininwqmamnf-121xvxnesgq232'
</code></pre>

<p>jasper occurs 3 times - one time each in sequence1,sequence2 and sequence3.
G1b occurs 2 times - one time in sequence1 and one time in sequence 2.</p>

<p>For each substring occuring two times or more, i need to add them to a dictionary as substring => count.
In this case my dictionary will be:</p>

<pre><code>dict = { 'jasper': '3', 'G1b': '2'}
</code></pre>

<p>I will be using thousands of sequences to fill up this dictionary and if one substring occurs two or more times in any of the sequences, it
needs to be added to this dictionary. What would be the best way to do it without crashing the system?</p>
