your code works fine when i just use:
print (preg_replace("!(/msg) ([a-z0-9\-]+) (.+?)!si", "\2:\3", $_POST["message"]));
the output prints the variables fine... but i want to use 2 seperate variables to represent the username and the message. i used this:
$eregusername = preg_replace("!(/msg) ([a-z0-9\-]+) (.+?)!si", "\2", $_POST["message"]);
$eregmessage = preg_replace("!(/msg) ([a-z0-9\-]+) (.+?)!si", "\3", $_POST["message"]);
for some reason the variable $eregusername's output is messed up
for example: when i put "/msg user message" in the form and then i print both of the variables $eregusername and $eregmessage i get "message" for $eregmessage but then i get "useressage" for $eregusername.