if($input =~ /^:(\S+)!\S+ PRIVMSG (\S+) :(.*)$/i) { my $test = $3; if($test =~ /.*\x20.*/) { $test =~ s/\x20/\n/g; print "$test\n"; } }