title: Find multiple instances of a string in a text file - python
body: <p>I'm trying to find multiple instances of a string in a text file but i can only work out a way to find the first instance. I've tried various while and for loops to no avail and i'm stuck for answers. What is the most efficient way to do this in python?</p>
  
  <pre><code>movinf = open("movinf.txt", "a")
          match = re.search('"string":([^,]+)', name)
          if match:
              result = match.group(1)
              movinf.write(result + "\n")
          else:
              pass
          movinf.close()
  </code></pre>