I have a string like this :
Hello-world Hi-people Hello-everybody
str_replace('-', ' ', $mystring);
Maybe instead of trying to select "-", focus on which strings you want to isolate? For instance, is it "Hello" or "Hi" followed by one word? Then this could work:
<?php $input = "Hello-world-Hi-people-Hello-everybody"; preg_match_all("/(Hello|Hi)-\w*/", $input, $output); echo implode(" ", $output);
I'm not very efficient with regex myself, but this could show the way.