regex_replace_in_campaign_body
Replace all matches of a JavaScript regex in a campaign body and save it, returning the replacement count; invalid patterns return an error and zero matches change nothing.
Instructions
Replace all matches of a JavaScript regular expression in a campaign's body and save the campaign. Reports how many matches were replaced and changes nothing if there is no match. An invalid pattern returns an error. For plain text use replace_in_campaign_body.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | JavaScript regular expression source without slashes, applied globally, e.g. https://old\.example\.com | |
| replace | Yes | Replacement text; may use capture groups such as $1 | |
| campaign_id | Yes | Campaign ID |