title: Regex for Replacing String with Incrementing Number
body: <p>Once upon a time I used UltraEdit for making this </p>
  
  <pre><code>text 1
  text 2
  text 3
  text 4
  ...
  </code></pre>
  
  <p>from that</p>
  
  <pre><code>text REPLACE
  text REPLACE
  text REPLACE
  text REPLACE
  ...
  </code></pre>
  
  <p>it was as easy as replace <code>REPLACE</code> with <code>\i</code></p>
  
  <p>now, how can I do this with eg. <code>sed</code>?</p>
  
  <p>If you provide a solution, could you please add directions for filling the result with leading zeros?</p>
  
  <p>thanks</p>