We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Following pattern supposes to match UTF8 byte sequences:
$regex = '/ ( (?: [\x00-\x7F] # single-byte sequences 0xxxxxxx | [\xC2-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx | \xE0[\xA0-\xBF][\x80-\xBF] # triple-byte sequences 1110xxxx 10xxxxxx * 2 | [\xE1-\xEC][\x80-\xBF]{2} | \xED[\x80-\x9F][\x80-\xBF] | [\xEE-\xEF][\x80-\xBF]{2} | \xF0[\x90-\xBF][\x80-\xBF]{2} # four-byte sequences 11110xxx 10xxxxxx * 3 | [\xF1-\xF3][\x80-\xBF]{3} | \xF4[\x80-\x8F][\x80-\xBF]{2} ){1,40} # ...one or more times ) | . # anything else /x';
The pcre replaces sanitized string by keeping only matched characters:
$value = preg_replace( $regex, '$1', $value );
for $value = "rřsšcč"; Expected: "rřsšcč Actual: "rsc"
$value = "rřsšcč";
"rřsšcč
"rsc"
The text was updated successfully, but these errors were encountered:
Note: this causes WordPress to fail to save any options containing Unicode characters
Sorry, something went wrong.
Fixed in peachpiecompiler/peachpie-perlregex@25d7e15 and peachpiecompiler/peachpie-perlregex@1174816. Bumping version of Peachpie.Library.RegularExpressions and referencing it should solve this.
Peachpie.Library.RegularExpressions
678104c
roberthusak
No branches or pull requests
Following pattern supposes to match UTF8 byte sequences:
The pcre replaces sanitized string by keeping only matched characters:
for
$value = "rřsšcč";
Expected:
"rřsšcč
Actual:
"rsc"
The text was updated successfully, but these errors were encountered: