title: Pythonically updating a value in a string
body: <p>I have strings that may include numbers in square brackets. If they do I'd like to increment up the number in the final set of square brackets up by one.</p>
  <pre><code>old_content='Some text\t\t[1.00]\nSome other text'
  </code></pre>
  <p>So far i have code that does that, but doesn't feel pythonic.</p>
  <pre><code>open_indexes = [i for i, c in enumerate(old_content) if c == &quot;[&quot;]
  close_indexes = [i for i, c in enumerate(old_content) if c == &quot;]&quot;]
  start       = old_content[:open_indexes[-1]+1]
  end         = old_content[close_indexes[-1]:]
  num         = old_content[open_indexes[-1]+1:close_indexes[-1]]
  num         = float(num)+1
  new_content =start +str(num) + end
  </code></pre>
  <p>Is there a more pythonic way of doing this?</p>