No, there's no helper to search&replace some text in templates. If you want to replace the XenForo Raw Code in template, use
TMS, otherwise you can modify parsed template code with two of the three template listeners: one at the hook level, the other one at the template level once it has been parsed.
In any cases, even with TMS, you can use direct text replacements (str_replace) or regex replacements (preg_replace).