I have auto generated string.
One of its elements is a group "/__nh".
Sometimes it is being multiplied, e.g.:
$string = some_stuff_here/__nh/__nh/__nh
I tried code below (and some other variation as well) to replace replace multiple instances with a single one:
return preg_replace('/(//__nh)+/', '/__nh', $string);
.. but I failed (regex is not something I'm comfortable with).