ipv4 validation regex code example
Example 1: ip address regex validate
^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
Example 2: regex ip rage detect
//Example 192.168-192.178
//192.168.0.1-192.168.0.255
(?<ipstart>(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])([\.]*)){4})-(?<ipend>(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])([\.]*)){4})$