Using Regular Expression is not a good choice to do that. You could use str_shuffle to scramble a string
http://php.net/manual/en/function.str-shuffle.php

PHP Code: 
<?php
$key 
$_SERVER['QUERY_STRING'];
$result str_shuffle($key);
echo 
"Original:<br/>";
echo 
$key."<br/>";
echo 
"Scrambled:<br/>";
echo 
$result;
?>