title: Python regex and replace with incremented number
body: <p>I have a file which contains in it several lines of problematic syntax, I'd like to do find all occurrences of it and replace it with acceptable syntax.</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;field id="someId" type="xs:decimal" bind="someId"&gt;
      &lt;description/&gt;
      &lt;region id="Calc.R_315.`0" page="1"/&gt;
      &lt;region id="Calc.R_315.`1" page="1"/&gt;
  &lt;/field&gt;
  </code></pre>
  
  <p>I'd like to a string replacement of all occurrences of </p>
  
  <pre><code>&lt;dot&gt;&lt;tick&gt;&lt;number&gt; i.e. .`0 or .`1 or .`2 et cetera
  </code></pre>
  
  <p>with </p>
  
  <pre><code>&lt;dash&gt;&lt;number&gt; i.e. -1 or -2 or -3
  </code></pre>
  
  <p>Notice it begins at 1 instead of 0.</p>
  
  <p>I have the following python code which performs an inline replacement of however it starts at 0, I'd like it to start at 1. </p>
  
  <pre><code>with fileinput.input(files="file.xml", inplace=True, backup='.original.bak', mode='r') as f:
      for line in f:
          pattern = "\.`(\d+)"
          result = re.sub(pattern, lambda exp: "-{}".format(exp.groups()[0]), line)
          print(result, end='')
  </code></pre>
  
  <p>How to accomplish my goal? </p>