title: vi editor: :s How to add constant to number in pattern
body: <p>I have a text file in which every line looks like this:</p>
  
  <pre><code>abcd123efgh[4]
  abcd456efgh[5]
  abcd789ijkl[6]
  abcd101efgh[7]
  abcd123efgh[8]
  </code></pre>
  
  <p>I want to add a constant to all numbers inside [], using vi editor. 
  For example, if the constant is 15, I want to change the lines above to:</p>
  
  <pre><code>abcd123efgh[19]
  abcd456efgh[20]
  abcd789ijkl[21]
  abcd101efgh[22]
  abcd123efgh[23]
  </code></pre>
  
  <p>I found </p>
  
  <pre><code>https://stackoverflow.com/questions/10420797/vim-regex-increment-all-numbers-by-1
  </code></pre>
  
  <p>which changes all the numbers in a file, but couldn't make the solution work for certain numbers only
  Thanks</p>