title: Avoid consuming input in Regex
body: <p>In Regex, I am given a string <strong>"abbabbabba"</strong> and I have to identify all the sub-strings having the pattern <strong>"abba"</strong> and when I try it this way:</p>
  
  <pre><code>import re
  a=re.findall(r'abba','abbabbabba')
  print(a)
  </code></pre>
  
  <p>I get my out put to be</p>
  
  <pre><code>['abba', 'abba']
  </code></pre>
  
  <p>Looking at the given string, there are 3 sub-strings of <strong>'abba'</strong> but only two have been printed. This clearly means that the second sub-string which has its <strong>'a'</strong> already consumed in 1st sub-string isn't allowing the function to identify the 2nd sub-string and hence it is directly jumping to the 3rd sub-string and hence only 2 <strong>'abba'</strong> sub-strings are printed. How to make sure that the input isn't consumed in this way and we get the output accordingly as:</p>
  
  <pre><code>['abba', 'abba', 'abba']  
  </code></pre>