use strict;
my $str = 'URL 123.45.67.8:http://www.google-analytics.com/r/collect?v=1&_v=j41&a=1071188231&t=pageview&_s=1&dl=http%3A%2F%2Fm.sherdog.com%2F&ul=en-us&de=UTF-8&dt=Sherdog.com%3A%20UFC%2C%20Mixed%20Martial%20Arts%20(MMA)%20News%2C%20Results%2C%20Fighting&sd=32-bit&sr=320x480&vp=320x460&je=0&_utma=236548035.1293902652.1385044241.1442
URL 123.34.45.7:http://captive.apple.com/hotspot-detect.html';
my $regex = qr/(url\s\d+[.]\d+[.]\d+[.]\d+[:](http|https|ftp).*)/ip;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html