add replace_pattern test