preg_replace vs preg_match

Thanks for trying to help, would you please re-write that code block on link using preg_replace that I understand better exactly? Note that not all patterns begin with O. so I guess we will still have 7 patterns? can they be in an array and replace all of them in just one preg_replace? replace to what to remove quoted part? with blank “”? if you provide a re-written code block I would be grateful.
Look forward hearing from you.