PhpStorm 8.0.0 Web Help

PhpStorm extends search and replace capability to the entire project, or any directory with its nested hierarchy. Explore search results in the Find tool window.

To find a piece of text in all the files within a specified path
  1. On the main menu, choose Edit | Find | Find in Path, or press FindInPathCtrl+Shift+FCtrl+Shift+FCtrl+Shift+FCtrl+Shift+FCtrl+Shift+FCtrl+Shift+FCtrl+HShift Command FShift Command FControl H.
  2. In the Find In Path dialog box, specify the following options:
    • The text to find. Type the text explicitly, or specify a pattern using a regular expression, or select a previously used piece of text or a pattern from the recent history drop-down list.

      Tip

      If you specify the search pattern through a regular expression, use the $n format in back references (to refer to a previously found and saved pattern).

    • Search scope (project , module or directory).
    • Search options (case sensitivity, whole words, and regular expressions).
  3. Click Find.

    Tip

    If the search takes too long time, click Background in the search progress window. In this case the search progress is indicated in the Status bar.

To replace a piece of text in all the files within a specified path
  1. On the main menu, choose Edit | Find | Replace in Path, or press ReplaceInPathCtrl+Shift+RCtrl+Shift+RCtrl+Shift+RCtrl+Shift+RCtrl+Shift+RCtrl+Shift+HReplaceInPathShift Command RShift Command RShift Command R.

    Alternatively, being in the Find In Path dialog box, press ReplaceInPathCtrl+Shift+RCtrl+Shift+RCtrl+Shift+RCtrl+Shift+RCtrl+Shift+RCtrl+Shift+HReplaceInPathShift Command RShift Command RShift Command R to switch to Replace In Path dialog box.

  2. In the Replace In Path dialog box, specify the search and replace strings, the search options, and the scope. Type the search and replacement text explicitly, or specify patterns using regular expression, or select a previously used piece of text or a pattern from the recent history drop-down list.

    Tip

    1. If you specify the search and/or replacement text through a regular expression, use the $n format in back references (to refer to a previously found and saved pattern).
    2. To use a backslash character \ in a regular expression, escape the meaningful backslash by inserting three extra backslashes in preposition: \\\\.
  3. Click Find. The encountered occurrences of the search string are displayed in the Find tool window, do one of the following:
    • Select one or more occurrences you want to replace and click the Replace selected button.
    • To have all the detected occurrences replaced, click the Do Replace All button.

Note

Use FindInPathCtrl+Shift+FCtrl+Shift+FCtrl+Shift+FCtrl+Shift+FCtrl+Shift+FCtrl+Shift+FCtrl+HShift Command FShift Command FControl H and ReplaceInPathCtrl+Shift+RCtrl+Shift+RCtrl+Shift+RCtrl+Shift+RCtrl+Shift+RCtrl+Shift+HReplaceInPathShift Command RShift Command RShift Command R to toggle between the Find In Path and Replace In Path dialog boxes.

See Also

Procedures:

Reference:

Web Resources: