WebStorm 2018.3 Help

Replace the found target

If you need to replace the search string you can either use the Replace in file or Replaces in Path actions.

On how to use regex with replace, refer to the find and replace with regex section.

Replace the search string in a file

  1. Press Ctrl+R or to open the Replace in File window.

  2. In the top field, enter your search string. In the bottom field, enter your replacement string.

    Replace in file pane
    Click the Multi-line icon for a multi-line replace. For example, if you want to replace a comma with a coma and a new line, enter a comma in the search field and a comma and the new line in the replace field.

  3. Click Replace to replace items one by one, Replace all to replace all items in your file, and Exclude to omit some items from replacing.

The options that appear in the Replace window, are similar to the Find window and you can refer to the manage the search results section.

Replace the search string in a project

  1. Press Ctrl+Shift+R to open the Replace in Path dialog.

  2. In the top field, enter your search string. In the bottom field, enter your replacement string.

    Replace in path dialog

  3. Click one of the available Replace commands.

Last modified: 12 December 2018