User Tools

Site Tools


action:Search_and_Replace

Table of Contents

**This is an old revision of the document!**

The Search and Replace action allows you to search and replace the System Clipboard, a Named Clipboard, the Trigger Clipboard (v8+), a variable, some tokenised text (v8+), or a file (v8+).

Prior to v8.0 there were separate Search and Replace Variable and Search and Replace Clipboard actions and the results always went back to the source variable or clipboard.

You can search for:

  • Strings, matching the case.
  • Strings, ignoring the case.
  • Regular Expression, matching the case.
  • Regular Expression, ignoring the case.

Select the source to search using the Search pop-up.

Select the kind of search to run, from the using pop-up. Then enter the text to search for in the text area.

Enter what to replace the found text with in the and replace with text area. Use the arrow at the right of the text area to select variables, clipboards and other tokens to enter in the text area. The replacement text can refer to captured matches using either $1 or \1 notation (eg %Calculate%CHARACTERS(\1)% would be the count of characters in the first capture match (v8+)).

Like other Text Fields, you can use text case conversion escape sequences like \U and \L in the replacement field.

Select where you want the result to be saved (back to the source, or to some other variable or clipboard or file).

Examples:

  • Search for a string such as Monday and replace with Tuesday.
  • Use a regular expression to search through a list of names where the last name appears first and switch them to be First Name Last Name. In its simplest form this could look like the following:

Search for: (.+) (.+) Replace with: $2 $1

Which results in:

See Also

Actions

Topics

Forum

action/Search_and_Replace.1561463520.txt.gz · Last modified: 2019/06/25 07:52 by peternlewis