title: Find specific string sections in python
body: <p>I want to be able to grab sections of strings with a function. Here is an example:</p>
  
  <pre><code>def get_sec(s1,s2,first='{',last='}'):
      start = s2.index(first)
      end = -(len(s2) - s2.index(last)) + 1
      a = "".join(s2.split(first + last))
      b = s1[:start] + s1[end:]
      print a
      print b
      if a == b:
          return s1[start:end] 
      else:
          print "The strings did not match up"
  string = 'contentonemore'
  finder = 'content{}more'
  print get_sec(string,finder)
  #'one'
  </code></pre>
  
  <p>So that example works...my issue is I want multiple sections, not just one. So my function needs to be able to work for any amount of sections, for example:</p>
  
  <pre><code>test_str = 'contwotentonemorethree'
  test_find = 'con{}tent{}more{}'
  print get_sec(test_str,test_find)
  #['one','two','three']
  </code></pre>
  
  <p>any ideas on how I can make that function work for an arbitrary number of replacements?</p>