http://qs321.pair.com?node_id=427316


in reply to Grepping out strings

If false positives weren't a problem, this would do:
@urls = $string =~ m!(?:\w+:/*)?(?:[\w\-]+\.)+\w+!g;
That would grab any number of words seperated by dots (without spaces), and would catch the protocol as well, if there is one.