Replace `mb_str_replace` implementation with `preg_replace`

https://gist.github.com/alecgorge/5130170