Hello,
This might be more of a PHP-thing than REGEX, but here's my problem:
I am using a HEX value to find and replace 'white spaces' with 'x':
take this example: $string = preg_replace('/[\x{20}]/u', 'x', $string);
But I want 'x' to be a HEX number that replaces '20', I have tried the following with no luck:
$string = preg_replace('/[\x{20}]/u', '\x{21}', $string);
I am replacing it with somthing outside of the displayable charecter range, so the replacement has to be in (and stored as) HEX form, can anyone help?
Replacing HEX with HEX using preg_replace()
Moderator: General Moderators