1. Handlebars Helpers
  2. Find and Replace

Handlebars Helpers

Find and Replace

Does a Regular Expression Find and Replace

Example definition:

Replace apple with orange.

editor
        {
    "tasktype": "savedata",
    "params": {
        "fieldname": "replacement_text",
        "savevalue": "{{#find_and_replace "/apple/gi" "orange"}}There are apples and pears{{/find_and_replace}}"
    }
}

      

Substituted definition

loading...

Multiline usage

Add the regex flag m to enable multiline mode.
Use regex101.com to test your regular expressions.

editor
        {
    "tasktype": "savedata",
    "params": {
        "fieldname": "replacement_text",
        "savevalue": "{{#find_and_replace "/(apple|pear)/gmi" "orange"}}There are apples and pears.\nThere are many apple baskets and pear baskets{{/find_and_replace}}"
    }
}

      

Substituted definition

loading...