title: Remove Space inside Quotes
body: <p>I'm trying to remove white spaces before and after a phrase which is placed inside double quotation marks. Whatever I've found on google removes the spaces alright but removes the spaces before and after the quotation marks too. </p>
  
  <pre><code>txt = "election laws \" are outmoded or inadequate and often ambiguous \" and should be changed."
  
  # output:
  "election laws\"are outmoded or inadequate and often ambiguous\"and should be changed."
  </code></pre>
  
  <p>This is the code:</p>
  
  <pre><code>import re
  
  regex = r"(?&lt;=[\"]) +| +(?=[\"])"
  
  test_str = "election laws \" are outmoded or inadequate and often ambiguous \" and should be changed."
  
  subst = ""
  
  # You can manually specify the number of replacements by changing the 4th argument
  result = re.sub(regex, subst, test_str, 0)
  
  if result:
      print (result)
  </code></pre>
  
  <p><strong>The expected output is:</strong></p>
  
  <pre><code>"election laws \"are outmoded or inadequate and often ambiguous\" and should be changed."
  </code></pre>
  
  <p>Please help.</p>