Skip to content

RegExp Replace In Note Button Action

This button action allows you to do a search and replace on the entire note where the button is in.

interface RegexpReplaceInNoteButtonAction {
type: 'replaceInNote';
regexp: string; // the regular expression to search for
replacement: string; // the replacement text
}

You can use $1, $2, etc. in the replacement text to reference the matched groups in the regular expression.

Example

This example replaces every TODO: ... line with TODO: ... - Done.

```meta-bind-button
style: primary
label: RexExp Replace In Note
action:
type: "regexpReplaceInNote"
regexp: "(TODO: .*)\\n"
replacement: "$1 - Done"
```