regex check is valid ip 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 check is valid ip

((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4}

Example 3: regex check is valid ip

"((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4}"

Example 4: 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})$

Tags:

Misc Example