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