+ } elseif ( preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $s ) ||
+ preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) ||
+ preg_match( '/^[0-9]{1,3}\.[0-9]{1,3}\.?$/', $s ) ||
+ preg_match( '/^[0-9]{1,3}\.$/', $s ) ) {
+ // IPv4 address