I have a regex ** **
I am using preg_match_all
method in PHP to match the Ips.
But it doesn't match the IP if the last octet is 3 digits.
Plz can anyone help me and let me know where I am going wrong.
Code is like:
$tnlip_regex = "/(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])[\.])(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])[\.])(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])[\.])(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5]))/";
preg_match_all($tnlip_regex, $row_data, $tnlip_matches);
$row_data
is the data from where I am finding IPs.
$tnlip_matches
is the array where I am putting them.