title: Find the position of the next occurrences in string
body: <p>I'm new to python, trying to get familiar with regular expressions, and string processing. I have written a regular expression by which numbers throughout a string are identified and extracted to an array. </p>
  
  <p>I want a parallel array which contains the positions of found terms.</p>
  
  <p>To clarify, suppose that the main string is: </p>
  
  <pre><code>text = '11 scholars are selected to comptete on Feb 20 , 2019. 
  Afterwards, 11 professors will review their submitted work. 
  The results will be announced on Mar 20 , 2019.'
  </code></pre>
  
  <p>As I said, I can match <code>nums = ['11', '20', '2019', '11', '20', '2019']</code> from the string above. Now, I want to form a synced array where stores the positions of each of these numbers. I'm using the following snippet:</p>
  
  <pre><code>positions = []
  for num in nums:
     pos = text.find(num)
     positions.append(num + ' : ' + str(pos))
  </code></pre>
  
  <p>The positions array contains: <code>positions = ['11 : 0', '20 : 44', '2019 : 49', '11 : 0', '20 : 44', '2019 : 49']</code> which obviously is not what I want. As there are duplicate numbers (like two 11's or 12's) in the list, <code>text.find(num)</code> returns the first occurrence of the term. So, when the program reaches the next occurrences of the token, it returns position of the first occurrence. </p>
  
  <p>Any thoughts on how to fix this?</p>