$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)}; $segment = qq{$pchar*}; $ftptype = q{[AIDaid]}; $path_segments = qq{$segment(?:/$segment)*(?:;type=$ftptype)?}; $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\\.?}; $host = qq{(?:$hostname|$IPv4address)}; $IP4hostport = qq{$host(?::$port)?}; $IP6hostport = qq{\\[$IPv6address\\](?::$port)?}; $hostport = qq{(?:$IP6hostport|$IP4hostport)}; $user = q{(?:[-_.!~*'()a-zA-Z0-9;&=+$,]|} . qq{$escaped)*}; $password = $user; $userinfo = qq{$user(?::$password)?}; $server = qq{(?:$userinfo\@)?$hostport}; $authority = qq{$server}; $scheme = q{f?tp}; $net_path = qq{//$authority(?:$abs_path)?}; $hier_part = qq{$net_path(?:\\?$query)?}; $absoluteURI = qq{$scheme:$hier_part}; $URI_reference = qq{$absoluteURI(?:#$fragment)?}; $ftp_URL_regex = q{\b} . $URI_reference; { my $len = 60; my @data = split(//,$ftp_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;