Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Text Find / Replace action allows you search for or replace a string. You can search in a file, or in variable contents. The search string can be plaintext or a regular expression. Wildcards are also available.

Find String

Image RemovedImage Added

Source

The text to search can be sourced from either a file, the contents of a variable, or from each of the files in a FileSet.

...

If checked, the search string will be treated as a regular expression. See the Regular Expression reference for details. If this option is set, the other search options listed above do not apply and will be grayed out.

Match instances

Replace

Image RemovedImage Added

Replace Options

...

Note

If the replacement text contains numbers adjacent to the substitution marker, escape it like this: ${1}

For example, if you want to replace every "ver <n>" with "ver <n>5" in strings like "Release ver 3 is now out", you could use "ver (\d+)" as the regular expression to match, and replace it with "ver ${1}5".

Behaviour

Image RemovedImage Added

Behaviour

You can choose to have the action fail if there are less than or more than a specified number of matches found. If replacement is enabled and the action fails because of too few or too many matches, then the replacement string is not written to the target file/variable. The only exception is when using FileSets and "Count total matches..." is enabled (see below.)

...