The hex sequences are the raw binary values for the Unicode code points.
Now that we have a more modern PHP at hand, we can use \x{FFFF} for
Unicode characters.
I believe the /S is not needed any more. It "precompiles" the regular
expression. But this is a pretty trivial regular expression.
Precompiling it is most probably even slower.
Change-Id: I49435114b3bc31dcce8aa4e48091d509844a2a07
# Strip Unicode bidi override characters.
# Sometimes they slip into cut-n-pasted page titles, where the
# override chars get included in list displays.
- $dbkey = preg_replace( '/\xE2\x80[\x8E\x8F\xAA-\xAE]/S', '', $dbkey );
+ $dbkey = preg_replace( '/[\x{200E}\x{200F}\x{202A}-\x{202E}]+/u', '', $dbkey );
# Clean up whitespace
# Note: use of the /u option on preg_replace here will cause