can someone convert this ereg_replace expression to preg_replace?
$string = mb_ereg_replace('([ -\.,\+\?\(\)\$\[\];_=])' .$oldvalue.'([ -\.,\+\?\(\)\$\[\];_=])',"\\1" .$newvalue."\\2",$string);
Basically, he searches for a string ($ oldvalue) preceded by a space or dash or a full or plus sign or brackets or brackets or a question mark or equal sign, followed by one of them and transforms it (regardless of what was previous ) $ newvalue (whatever).
I need to switch to preg_replace due to technical limitations, I hope someone can help!
Thanks!
source share