This operation allows you to:
- Find multiple occurrences of a word or sequence of characters across all of your configuration files.
- In one click replace all of these occurrences with another string.
- 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.
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.
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.
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: **/folerName/**
Add “!” as a prefix to negate your rule, e.g., to exclude all .nacl files, use !**/.nacl
Replacing search matches could be done in 1 of 4 of the following methods:
- Replace All - replaces all occurrences in all matching results.
- Replace all in folder - by right clicking over a folder and selecting “Replace all in folder” from the menu.
- Replace all in file - by right clicking over a single file and selecting “Replace all in file” from the menu.
- Replace a single occurrence by right clicking over a single occurrence and selecting ‘Replace occurrence’
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.
- 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.
- Find & replace is only available from Workspaces, as opposed to Shared environments due to the read-only nature of environments.
Updated about 1 month ago