You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP Warning: mb_ereg_replace(): mbregex search failure in php_mbereg_replace_exec(): retry-limit-in-match over in /vendor/vanderlee/php-sentence/src/Multibyte.php on line 59
#27
Open
splitbrain opened this issue
Jun 9, 2023
· 0 comments
I have no idea why it fails. I'm also not 100% sure why a UTF-8 aware method is needed here. Is it to remove non-ASCII whitespaces like non-breaking or half-width spaces? Would using preg_replace with the /u flag be an alternative?
The text was updated successfully, but these errors were encountered:
splitbrain
added a commit
to splitbrain-forks/php-sentence
that referenced
this issue
Jun 9, 2023
I get above warning for some of my content. The problem happens in the trim() method:
php-sentence/src/Multibyte.php
Lines 57 to 60 in ed7ce41
When the warning is throw, mb_ereg_replace will return false instead of a string, breaking the rest of the script.
I created a test case to demonstrate the problem: splitbrain-forks@914dd45
I have no idea why it fails. I'm also not 100% sure why a UTF-8 aware method is needed here. Is it to remove non-ASCII whitespaces like non-breaking or half-width spaces? Would using preg_replace with the /u flag be an alternative?
The text was updated successfully, but these errors were encountered: