core: fix regex replace in eval_expression when regex or regex_replace is empty
tests: add tests of regex replace with empty regex or regex_replace