title: Replace particular string at fixed position using sed
body: <p>I have a simple text file containing several lines of data where each line has got exactly 26 characters.
  E.g.</p>
  
  <pre><code>10001340100491938001945591
  10001340100491951002049591
  10001340100462055002108507
  10001340100492124002135591
  10001340100492145002156507
  10001340100472204002205591
  </code></pre>
  
  <p>Now, I want to replace 12th and 13th character if only these two characters are 49 with characters 58.</p>
  
  <p>I tried it like this:</p>
  
  <pre><code>sed 's/^(.{12})49/\58/' data.txt
  </code></pre>
  
  <p>but am getting this error:</p>
  
  <pre><code>sed: -e expression #1, char 18: invalid reference \5 on `s' command's RHS
  </code></pre>
  
  <p>Thanks in advance</p>