Find and Replace
Support avatar
Written by Support
Updated over a week ago

(!) Available in the Pro and Enterprise plans

Overview

This operation allows you to:

  1. Find multiple occurrences of a word or sequence of characters across all of your configuration files.

  2. In one click replace all of these occurrences with another string.

  3. You can do this across all of the environments within a workspace at once.

To access this flow, select a workspace and choose ‘Find and Replace’ via the workspace action menu (available from the 3 dots menu near the workspace search bar) or via the bottom button within the Text search tab.

1452

Type any search query in the Search term input in order to find your desired string (Regex support coming soon!). If relevant, make sure to use the ‘Case sensitive’ option below the search bar. As you type the query in, matching search results appear in the list.

The Replace term input should be used to provide the desired text to replace the prior search term.

The file (diff) view

When clicking on a file from the results list, a diff view of this file is shown.
Files are viewed in either the unified or split modes. To switch between these view modes, click the upper right option.

Text that would be replaced (removed) is shown in red. The new text that will be inserted into the file is shown in green.
If the replace term is left blank and ‘Replace’ is pressed, the relevant matches would be replaced with an empty string.

1581

In order to add additional include and exclude rules, click the Filter option below the search bar.

Adding terms into the include field would force the inclusion of matching files and folders into the search result list. Similarly, adding terms into the exclude field would exclude them from search results.

A simple way to exclude search results is by right clicking over a result, and selecting “Exclude” from the menu. (Note that the respective exclude term would be automatically added into the exclude field).

Include and exclude rules are written using globes.

📘 Some examples of globes:

Search by file extension: **/.nacl
Search by file name: **/account**
Search by starting folder: envs/envName/**
Search by folder name: **/folderName/**

Add “!” as a prefix to negate your rule, e.g., to exclude all .nacl files, use !**/.nacl

1600

Replacing search matches

Replacing search matches could be done in 1 of 4 of the following methods:

  1. Replace All - replaces all occurrences in all matching results.

  2. Replace all in folder - by right clicking over a folder and selecting “Replace all in folder” from the menu.

  3. Replace all in file - by right clicking over a single file and selecting “Replace all in file” from the menu.

  4. Replace a single occurrence by right clicking over a single occurrence and selecting ‘Replace occurrence

1600

🚧 Replacing text via Find and Replace takes effect on the local copy of your workspace. A deploy operation is required in order to update the application with this change. Click here to learn how change management works.

Additional notes:

  1. Results are limited to 10,000 matches. Search queries that result in more than 10k matches would be trimmed. In this case you can fine tune your search query in order to reduce the number of matching search results.

  2. Find & replace is only available from Workspaces, as opposed to Shared environments due to the read-only nature of environments.


Did this answer your question?