$digit = q{[0-9]}; $alpha = q{[a-zA-Z]}; $alphanum = q{[a-zA-Z0-9]}; $hex = q{[0-9A-Fa-f]}; $escaped = qq{%$hex$hex}; $uric = q{(?:[-_.!~*'()a-zA-Z0-9;/?:@&=+$,]} . qq{|$escaped)}; $fragment = qq{$uric*}; $query = qq{$uric*}; $pchar = q{(?:[-_.!~*'()a-zA-Z0-9:@&=+$,]} . qq{|$escaped)}; $param = qq{$pchar*}; $segment = qq{$pchar*(?:;$param)*}; $path_segments = qq{$segment(?:/$segment)*}; $abs_path = qq{/$path_segments}; $port = qq{$digit*}; $IPv4address = qq{$digit+\\.$digit+\\.$digit+\\.$digit+}; $IPv6address = qq{(?:$hex*:){2,7}$hex*}; $toplabel = qq{$alpha(?:} . q{[-a-zA-Z0-9]*} . qq{$alphanum)?}; $domainlabel = qq{$alphanum(?:} . q{[-a-zA-Z0-9]*} . qq{$alphanum)?}; $hostname = qq{(?:$domainlabel\\.)*$toplabel\\.?}; $IP4host = qq{(?:$hostname|$IPv4address)}; $host = qq{(?:$IP4host)}; $IP4hostport = qq{$host(?::$port)?}; $IP6hostport = qq{\\[$IPv6address\\](?::$port)?}; $userinfo = q{(?:[-_.!~*'()a-zA-Z0-9;:&=+$,]|} . qq{$escaped)*}; $server = qq{(?:$userinfo\@)?(?:$IP4hostport|$IP6hostport)}; $authority = qq{$server}; $scheme = q{(?:h?ttps?|shttp)}; $net_path = qq{//$authority(?:$abs_path)?}; $hier_part = qq{$net_path(?:\\?$query)?}; $absoluteURI = qq{$scheme:$hier_part}; $URI_reference = qq{$absoluteURI(?:#$fragment)?}; $http_URL_regex = q{\b} . $URI_reference; { my $len = 60; my @data = split(//,$http_URL_regex); $i = 0; while(1){ $out .= 'q{'; $out .= join('', @data[($len * $i) ..($len - 1 + ($len * $i))]) ; $out .= '} .' . "\n"; $i++; last if(!exists $data[$len * $i]); } } print $out;