Hi,
I've just started using Ruby last week and have a somewhat complex task to
complete in a short amount of time and nobody local to ask.

Here is what I'm trying to find:
Given two arrays containing IP addresses like the ones below, how would I
search for the first element in 'servers' that pattern matches and element
in 'nics' where only the first 2 parts of the IP addresses need to match,
like 192.168.*.* or 10.14.*.* or 98.139.*.*

servers = Array["192.168.0.251","10.14.0.142","98.139.180.149"]
nics = Array["10.10.0.255","173.194.37.16","10.14.0.170"]

I've got some kind of beginning with the code below but I'm stuck. Any
hints?

----------------
log_server = "nothing"

until log_server != "nothing" servers.each |thisip| do

# Consider only the first two parts of the 'thisip' IP address (192.168.*.*
or 10.14.*.* or 98.139.*.*)
# Compare it with each element in 'nics'
# Set 'log_server' equal to the first value of 'thisip' that pattern
matches an element in 'nics'
log_server = thisip

end
----------------

Thanks in advance
Chaim