Regex to extract only IPv4 addresses from text
问题 I've tried to extract only IP addresses from the the given example input, but it extracts some text with it. Here's my code: $spfreccord="v=spf1 include:amazonses.com include:nl2go.com include:smtproutes.com include:smtpout.com ip4:46.163.100.196 ip4:46.163.100.194 ip4:85.13.135.76 ~all"; $regexIpAddress = '/ip[4|6]:([\.\/0-9a-z\:]*)/'; preg_match($regexIpAddress, $spfreccord, $ip_match); var_dump($ip_match); I'm looking to match only the IPv4 IP address xxx.xxx.xxx.xxx in each column of the