$re = '/(?P<host>.*?) (?P<code>.*?) (?P<name>.*?) = (?P<msg>.*)/';
$str = ':morgan.freenode.net 353 MechaBot = #xshellz :MechaBot ITechGeek zubuntu whitesn JarodRo SpeedFuse st3v0 anyx danielhyuuga1 AussieKid92 JeDa Failed Guest83885 RiXtEr xryz D-Boy warsoul buggiz rawwBNC MagixZ fedai Sunborn oatgarum dune SamUt Pythonista_ +xinfo madmattco BuGy azuan DarianC stupidpioneers AnTi_MTtr JeDaYoshi|Away PaoLo- StephenS chriscollins Rashk0 morbid1 Lord255 victorix [DS]Matej EvilSoul `|` united Scrawn avira ssnova munsterman Logxen niko gorut Jactive|OFF grauwulf b0lt saapete';
preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 0);
// Print the entire match result
var_dump($matches);
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 PHP, please visit: http://php.net/manual/en/ref.pcre.php