fix regex and replace evaluation