I'm having some odd issues with preg_replace...I'm trying to replace any unusual nondisplayable characters (everything with an ordinal less than \x32, except CRs, LFs, and tabs), but the regular expression that would normally work in perl doesnt seem to be working in php. I assume I'm missing some subtle language difference...This:
<?php
$string = "Testing\t\x01...\x02...\x03...\n";
$result = preg_replace('/[\x01-\x08\x11-\x12\x14-\x31]/', 'X', $string);
echo "{$result}\n";
?>
Should produce [FONT="Courier New"]"Testing\tX...X...X...\n"[/FONT], but it instead produces [FONT="Courier New"]"Testing\tXXXXXXXXXXXX\n"[/FONT]. I've tried using single and double quotes on the pattern, but I get the same result either way. I've even tried the effective inverse of [FONT="Courier New"]"/[\x09-\x10\x13\x32-\x7F]/"[/FONT], but still with the same result...