I cant figure out preg_replace at all, it just looks chinese to me, anyway I just need to remove \"&page-X\" from a string if its there.
&page-X
X
preg_replace uses Perl-Compatible Regular Expression for the search pattern. Try this pattern:
preg_replace('/&page-\d+/', '', $str)
See the pattern syntax for more information.