Skip to main content

pattern-escape

Syntax

- pattern-escape

Description

The pattern-escape operation safely escapes an incoming string value so that it can be embedded in a regular expression further down. This operation is only needed when you intend for the value passing through to be part of the pattern itself, not the string that you are applying a regular expression to for search or replace.

Examples

  name_var:
- source: programfile
- pattern-escape
program_var:
- source: program-header
- pattern-match:
pattern: /\(${name_var}\)/
info

In the above example, programfile and programheader are identifiers from another part of the adapter script.