I want to extract an IP address from a string (actually a one-line HTML) using Python.
>>> s = "<html><head><title>Current IP Check</title></head><body>Current IP Address: 165.91.15.131</body></html>"
-- '165.91.15.131' is what I want!
I tried using regular expressions, but so far I can only get to the first number.
>>> import re
>>> ip = re.findall( r'([0-9]+)(?:\.[0-9]+){3}', s )
>>> ip
['165']
But I don't have a firm grasp on reg-expression; the above code was found and modified from elsewhere on the web.