replace_in_note
Replace text or regex patterns inside a note body with options for case sensitivity, whole-word matching, and dry-run preview. Never touches frontmatter and supports guarded writes.
Instructions
Find and replace text within a note body. Supports literal and regex search, case sensitivity, whole-word matching, and a replacement limit. Frontmatter is never touched. Use dryRun to preview matches before writing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| find | Yes | Text or pattern to find. | |
| path | Yes | Vault-relative path to the note. | |
| limit | No | Maximum number of replacements. Omit to replace all. | |
| regex | No | Treat find as a regular expression. Default false. | |
| dryRun | No | If true, report matches without writing. Default false. | |
| replace | Yes | Replacement text. Supports $1, $2, … backreferences in regex mode. | |
| prevHash | No | Optional compare-and-swap guard: the contentHash from a prior read. Fails with hash_conflict if the note changed since. | |
| wholeWord | No | Match whole words only (\b boundary). Default false. | |
| caseSensitive | No | Case-sensitive matching. Default false. |