$bla="ftp://asdf:bsfsf@127.0.0.1:21"; ($user, $pass, $ip, $port) = $bla =~ /^ftp\:\/\/([^:]+):([^\@]+)\@([^:]+):(.+)$/; print "$user - $pass - $ip - $port"