replace_in_file
Search and replace all occurrences of a regex pattern with a target string in a file, enabling precise content modifications with optional single-match enforcement.
Instructions
Replace all occurrences of a regex pattern with a target string in a file.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
file_path | Yes | Absolute path to the file | |
multiple | No | Allow multiple replacements. If false, fails if multiple matches found. | |
regex_source | Yes | Regular expression pattern to search for | |
target | Yes | String to replace matches with |