title: Find and replace string between quotes
body: <p>I'm reading a file and I would like to replace any text which appears between two double quotes like this:</p>
  
  <p>If file input is:</p>
  
  <blockquote>
    <p>Hi, I'm an example file! "Hi there example file."</p>
    
    <p>"I'm mostly just here to get this quote to be colored!"</p>
  </blockquote>
  
  <p>Output should be:</p>
  
  <blockquote>
    <p>Hi, I'm an example file! [color=x]"Hi there example file."[/color]</p>
    
    <p>[color=x]"I'm mostly just here to get this quote to be colored!"[/color]</p>
  </blockquote>
  
  <p><br>
  I've wrote these three modules to do that, the first two work but the last doesn't.</p>
  
  <p>Module 1:</p>
  
  <pre><code>__author__ = 'Joker'
  import os
  import sys
  import re
  import fileinput
  
  print ("Text to search for:")
  textToSearch = ( '" ' )
  
  print ("Text to replace it with:")
  textToReplace = ( '"[/color] ' )
  
  print ("File to perform Search-Replace on:")
  fileToSearch  = ( "D:\Coding projects\post edit\post.txt" )
  
  
  tempFile = open( fileToSearch, 'r+' )
  
  for line in fileinput.input( fileToSearch ):
      if textToSearch in line :
          print('Match Found')
      else:
          print('Match Not Found!!')
      tempFile.write( line.replace( textToSearch, textToReplace ) )
  tempFile.close()
  
  input( '\n\n Press Enter to exit...' )
  </code></pre>
  
  <p>Module 2:</p>
  
  <pre><code>__author__ = 'Joker'
  import os
  import sys
  import re
  import fileinput
  
  print ("Text to search for:")
  textToSearch = ( ' "' )
  
  print ("Text to replace it with:")
  textToReplace = ( ' [color=#66ccff]"' )
  
  print ("File to perform Search-Replace on:")
  fileToSearch  = ( "D:\Coding projects\post edit\post.txt" )
  
  tempFile = open( fileToSearch, 'r+' )
  
  for line in fileinput.input( fileToSearch ):
      if textToSearch in line :
          print('Match Found')
      else:
          print('Match Not Found!!')
      tempFile.write( line.replace( textToSearch, textToReplace ) )
  tempFile.close()
  
  input( '\n\n Press Enter to exit...' )
  </code></pre>
  
  <p>Module 3:</p>
  
  <pre><code>__author__ = 'Joker'
  import os
  import sys
  import re
  import fileinput
  
  print ("Text to search for:")
  textToSearch = ( r'\n"')
  
  print ("Text to replace it with:")
  textToReplace = (r'\n[color=#66ccff]"' )
  
  print ("File to perform Search-Replace on:")
  fileToSearch  = ( "D:\Coding projects\post edit\post.txt" )
  
  tempFile = open( fileToSearch, 'r+' )
  
  for line in fileinput.input( fileToSearch ):
      if textToSearch in line :
          print('Match Found')
      else:
          print('Match Not Found!!')
      tempFile.write( line.replace( textToSearch, textToReplace ) )
  tempFile.close()
  
  input( '\n\n Press Enter to exit...' )
  </code></pre>
  
  <p><strong>Bonus:</strong> is there a way to combine the functionality of these three modules into one?</p>