danielstjules / Stringy

A PHP string manipulation library with multibyte support
MIT License
2.46k stars 216 forks source link

preg_replace(): Unknown modifier ']' #194

Open nvirth opened 5 years ago

nvirth commented 5 years ago

Executing these:

use Stringy\Stringy;

$text = Stringy::create('/asd/qwe/');
$text = $text->trim(' \\/');

(A)

With mbstring extension enabled in php.ini
=> It works fine, result is 'asd/qwe'

(B)

Without mbstring => It is buggy, result is '', and there is a php warning: preg_replace(): Unknown modifier ']'