replace

Replace one or more strings or regular expressions.

Syntax

{{ value | replace:"old":"new" }}{{ value | replace:("a":"b", "c":"d") }}

Example

01

Basic usage

InputTS
1{2  "message": "hello world"3}
TemplateKNAP
1{{ message | replace:"e":"a","o":"0" }}
OutputKNAP
1hall0 w0rld

Behavior

  • Each quoted search value is followed by a colon and its replacement.
  • Regular expressions may include flags, for example "/[aeiou]/g".