title: Regex.Replace for IP address
body: <p>I've lifted a piece of code from somewhere on the internet it looks like this</p>
  
  <pre><code> ip = Regex.Replace(ip, @"^(?&lt;Prefix&gt;(\d{1,3}\.){3})\d{1,3}$", "${Prefix}*");
  </code></pre>
  
  <p>What it does is takes an IP address and replaces the last section with a asterisk. For example <code>192.168.0.1</code> would become <code>192.168.0.*</code></p>
  
  <p>I'm useless with RegEx, I've tried to understand what the above is actually doing, but not having any success.</p>
  
  <p>What I'm after is 2 more <code>Regex.Replace</code> code so that <code>192.168.0.1</code> becomes</p>
  
  <ul>
  <li><code>192.168.*.*</code></li>
  <li><code>192.*.*.*</code></li>
  </ul>
  
  <p>Can anyone help me?</p>