core: move function string_replace before string_replace_regex