, String.scan , , . , :
[['http', '.google.com'], ...]
/(?:stuff)/, .
( ): , . (^ $), , content. -, ([0-9]{1,5})? , , , .
: , - :
content = "Here is the list of URLs: http://www.google.com http://www.google.com/index.html http://example.com:3000/foo"
urls = content.scan(/(?:http|https):\/\/[a-z0-9]+(?:[\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(?:(?::[0-9]{1,5})?\/[^\s]*)?/ix)
... , URL- IP- (, http://127.0.0.1), - [a-z]{2,5} TLD.