I don't know anything about preg_match but I can figure this part out, Addslashes doesn't do what you need it to do. Addshalshes is used to put slashes before a quotation mark for compatibility not to add slashes to a perl expression.
I'm guessing that you wish to put slashes on either the ends (begining and end) of the $clip values or in between each char.
So for the ends just do this.
$clip = "/".chr(82) . chr(83) . chr(00) . chr(00)."/";
Or if it's between each value the the easiest way would be to create an array and implode() it.
$array[] = chr(82);
$array[] = chr(83);
$array[] = chr(00);
$array[] = chr(00);
$clip = implode("/",$array)
I guess the thing to remember is that php doesn't really destingush between a text file and a binary file, it leave that part up to you.