title: Python Text parsing - Do you know why the double empty quotes appear where for me there is nothing in between?
body: <p>I'm parsing a file with many lines such as the following one:</p>
  
  <pre><code>ocngPrbSerie : [{prbFirst=0, prbLast=0, pdschModType=QPSK_MOD_SCH, usedSubFrameNo=[false, false, false, false, false, false, false, false, false, false]}, {prbFirst=0, prbLast=0, pdschModType=QPSK_MOD_SCH, usedSubFrameNo=[false, false, false, false, false, false, false, false, false, false]}]
  </code></pre>
  
  <p>What I'm trying to do is put into quotes everything except structure (meanning [[]{},=\s:) to insert into mongodb database after rebuild the string once the quotes are put in place. I want to leave the numbers without quotes as well.</p>
  
  <p>What I have so far:</p>
  
  <pre><code>    f = open(filepath, "r")
      for line in f:
          x = re.split("([\[\]{},=\s:])", line)
          print(line)
          i = 0
          while i &lt; len(x):
              if re.search("([\[\]{},=\s:])",x[i]) is None:
                  x[i] = "\u0022" + x[i] + "\u0022"
              print(x[i])
              i = i+1
  </code></pre>
  
  <p>The result is quite as expected, in terms of putting the quotes, but as you can see in the print of the firsts lines of the result, some lines are like this "" (double empty quotes) but if you check the line I'm processing there is nothing between [ and { but the print appears like [ "" {</p>
  
  <blockquote>
    <p>"ocngPrbSerie"</p>
    
    <p><strong>""</strong> : <strong>""</strong></p>
    
    <p><strong>""</strong> [ <strong>""</strong> { "prbFirst"
    = "0" , <strong>""</strong></p>
  </blockquote>
  
  <p>Do you know why the double empty quotes appear, where for me there is nothing in between?</p>
  
  <p>Also any improve in the code is welcome, I'm kind a newbie in python.</p>
  
  <p>Many thanks</p>