How to write a check for ip in VirtualParameters

Good afternoon, please tell me how to check for ip in virtualparametrs. I used the standard script from the genieacs docs for mac.

But at the output I get 0.0.0.0 because the router transmits 0.0.0.0 in 1.ExternalAddress.

InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress 0.0.0.0
InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.2.ExternalIPAddress 192.168.70.4

How can I check for the subnet 192.168..?

Spin through the results and filter for the one that looks valid. In this case:

if(p.value[0] && p.value[0].startsWith('192.168')) {
  m = p.value[0];
  break;
}