title: sed regex match and replace any last digit
body: <p>I have lots of file containing following ipaddress, and i want to replace last digit of ip and look like i am having struggle to come up with correct regex</p>
  
  <p>file1</p>
  
  <pre><code>IPADDR=10.30.2.26
  NETMASK=255.255.0.0
  GATEWAY=10.30.0.1
  </code></pre>
  
  <p>I want to replace <code>10.30.2.26</code> to <code>10.30.2.27</code> using sed but somehow i am missing something, i have tried following.</p>
  
  <p>I have many file which i want to replace and last digit could be anything. </p>
  
  <p>I have tried <code>sed 's/[^IPADDR].$/7/g' file1</code>  </p>
  
  <p>how do i match anything between <code>^IPADDR{anything}$</code> ?</p>