my ( $peer, $ip, $type, $mask, $port, $status ) = ( $line =~ /
# ^ # Start of line
([\w\d\.\-_]+) # First capture, peer name
\/?\s+? # Optional trailing slash, optional space
# \(? # Optional opening parenthesis
([\w\d\.]+) # Second capture, IP address
# \)? # Optional closing parenthesis
\s+? # Optional space
# \(? # Optional open parenthesis
([\w\d\.]+) # Third capture, type
# \)? # Optional ending parenthesis
\s+? # Optional space
([\w\d\.]+) # Forth capture, mask
\s+? # Optional space
([\w\d\.]+) # Fifth capture, port
\s+? # Optional space
([\w\d\.]+) # Final capture, status
# $ # End of line
/x );
Not matching either of these:
rpc-pbx-glb-01/ (Unspecified) (S) 255.255.255.255 4569 UNKNOWN
rpc-pbx-peo-01/ 10.1.1.252 (S) 255.255.255.255 4569 UNREACHABLE