how to obtain ip from file?

file content:

foo
bar
 a 123.111.111.111 single ip always
 bar

how do i get the ip into a variable? preferably by regex.

bump. urgent.

I remember I saw a script with service of some member here that provides publicly the ip blacklist. Search for it and get inspired by his script…