我想从以下输出中检索 IP 地址。
vmnet1 Link encap:Ethernet
inet addr:192.168.185.1 Bcast:192.168.185.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
我想获取 IP 和掩码,结果将是
192.168.185.1
255.255.255.0
谁能告诉我正则表达式?