master merge for regex_replace