# プロジェクト内で検索して置換

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/clion/llms.txt).

プロジェクト内のターゲットの出現と使用方法を検索し、さまざまな範囲を使用して特定の項目を除外することで検索範囲を絞り込むことができます。

Procedure: プロジェクトで検索文字列を見つける

1. `Ctrl+Shift+F` (Windows), `⌘ ⇧ F` (macOS), `⌃ ⇧ F` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ F` (macOS System Shortcuts), `Ctrl+Shift+F` (XWin), `Ctrl+Shift+F` (GNOME), `Ctrl+Shift+F` (KDE), `Ctrl+Shift+F` (Emacs), `Ctrl+Shift+F` (Sublime Text), `⌘ ⇧ F` (Sublime Text (macOS)), `⌘ ⇧ F` (Xcode), `Ctrl+Shift+F` (Visual Studio), `⌘ ⇧ F` (Visual Studio (macOS)), `Ctrl+Shift+F` (ReSharper), `⌘ ⇧ F` (ReSharper (macOS)), `Ctrl+Shift+F` (QtCreator), `⌘ ⇧ F` (QtCreator (macOS)), `Ctrl+Shift+F` (NetBeans), `Ctrl+H` (Eclipse), `⌃ H` (Eclipse (macOS)) を押すか、メインメニューから  `編集 | 検索 | 複数ファイル内検索`  を選択します。

2. 検索フィールドに検索文字列を入力します。 または、エディターで検索する文字列をハイライトして `Ctrl+Shift+F` (Windows), `⌘ ⇧ F` (macOS), `⌃ ⇧ F` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ F` (macOS System Shortcuts), `Ctrl+Shift+F` (XWin), `Ctrl+Shift+F` (GNOME), `Ctrl+Shift+F` (KDE), `Ctrl+Shift+F` (Emacs), `Ctrl+Shift+F` (Sublime Text), `⌘ ⇧ F` (Sublime Text (macOS)), `⌘ ⇧ F` (Xcode), `Ctrl+Shift+F` (Visual Studio), `⌘ ⇧ F` (Visual Studio (macOS)), `Ctrl+Shift+F` (ReSharper), `⌘ ⇧ F` (ReSharper (macOS)), `Ctrl+Shift+F` (QtCreator), `⌘ ⇧ F` (QtCreator (macOS)), `Ctrl+Shift+F` (NetBeans), `Ctrl+H` (Eclipse), `⌃ H` (Eclipse (macOS)) を押すか、コンテキストメニューから   複数ファイル内検索   を選択します。 CLion はハイライトされた文字列を検索フィールドに入力します。

以前の検索のリストを表示するには、 `Alt+Down` (Windows), `⌥ ↓` (macOS), `⌥ ↓` (IntelliJ IDEA Classic (macOS)), `⌥ ↓` (macOS System Shortcuts), `Alt+Down` (XWin), `Alt+Down` (GNOME), `Alt+Down` (KDE), `Alt+Down` (Emacs), `Alt+Down` (Sublime Text), `⌥ ↓` (Sublime Text (macOS)), `⌥ ↓` (Xcode), `Alt+Down` (Visual Studio), `⌥ ↓` (Visual Studio (macOS)), `Alt+Down` (ReSharper), `⌥ ↓` (ReSharper (macOS)), `Alt+Down` (QtCreator), `⌥ ↓` (QtCreator (macOS)), `Alt+Down` (NetBeans), `Alt+Down` (Eclipse), `⌥ ↓` (Eclipse (macOS)) を押します。

![複数ファイル内検索](https://resources.jetbrains.com/help/img/idea/2026.3/cl_findinpath_window.png)

複数行検索を行うには、 ![複数行検索](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.searchNewLineHover.svg) アイコンをクリックして新しい行を入力し、 `Ctrl+Alt+Down` (Windows), `⌘ ⌥ ↓` (macOS), `⌘ ⌥ ↓` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ↓` (macOS System Shortcuts), `Ctrl+Alt+Down` (XWin), `Alt+Shift+Down` (GNOME), `Ctrl+Alt+Down` (KDE), `Ctrl+Alt+Down` (Emacs), `Ctrl+Alt+Down` (Sublime Text), `Ctrl+Alt+Down` (Sublime Text (macOS)), `⌃ ↓` (Xcode), `Ctrl+Alt+Down` (Visual Studio), `⌘ ⌥ ↓` (Visual Studio (macOS)), `Ctrl+Alt+Down` (ReSharper), `⌘ ⌥ ↓` (ReSharper (macOS)), `Ctrl+Alt+Down` (QtCreator), `Ctrl+Alt+Down` (QtCreator (macOS)), `Ctrl+Alt+Down` (NetBeans), `Ctrl+Alt+Down` (Eclipse), `Ctrl+Alt+Down` (Eclipse (macOS)) / `Ctrl+Alt+Up` (Windows), `⌘ ⌥ ↑` (macOS), `⌘ ⌥ ↑` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ↑` (macOS System Shortcuts), `Ctrl+Alt+Up` (XWin), `Alt+Shift+Up` (GNOME), `Ctrl+Alt+Up` (KDE), `Ctrl+Alt+Up` (Emacs), `Ctrl+Alt+Up` (Sublime Text), `Ctrl+Alt+Up` (Sublime Text (macOS)), `⌃ ↑` (Xcode), `Ctrl+Alt+Up` (Visual Studio), `⌘ ⌥ ↑` (Visual Studio (macOS)), `Ctrl+Alt+Up` (ReSharper), `⌘ ⌥ ↑` (ReSharper (macOS)), `Ctrl+Alt+Up` (QtCreator), `⌘ ⌥ ↑` (QtCreator (macOS)), `Ctrl+Alt+Up` (NetBeans), `Ctrl+Alt+Up` (Eclipse), `Ctrl+Alt+Up` (Eclipse (macOS)) を押して出現箇所を参照します。

3. 検索文字列を置き換えるか、別の文字列を選択するか、 `Ctrl+Shift+F` (Windows), `⌘ ⇧ F` (macOS), `⌃ ⇧ F` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ F` (macOS System Shortcuts), `Ctrl+Shift+F` (XWin), `Ctrl+Shift+F` (GNOME), `Ctrl+Shift+F` (KDE), `Ctrl+Shift+F` (Emacs), `Ctrl+Shift+F` (Sublime Text), `⌘ ⇧ F` (Sublime Text (macOS)), `⌘ ⇧ F` (Xcode), `Ctrl+Shift+F` (Visual Studio), `⌘ ⇧ F` (Visual Studio (macOS)), `Ctrl+Shift+F` (ReSharper), `⌘ ⇧ F` (ReSharper (macOS)), `Ctrl+Shift+F` (QtCreator), `⌘ ⇧ F` (QtCreator (macOS)), `Ctrl+Shift+F` (NetBeans), `Ctrl+H` (Eclipse), `⌃ H` (Eclipse (macOS)) をもう一度押して新しい検索を開始するダイアログのプレビュー領域で結果を確認します。

4. 出現箇所のリストを別のツールウィンドウに表示するには、   検索ウィンドウで開く   をクリックします。 このウィンドウとそのオプションを使用して、結果をグループ化し、プレビューし、さらに操作します。

新しい検索結果をそれぞれ   検索   ツールウィンドウの個別のタブに表示する場合は、   複数ファイル内検索   ダイアログの下部にある   結果を新規タブで開く   チェックボックスを選択します。

Procedure: 見つかったファイルのパスまたは参照をコピーする

1. 検索結果のリストで、パスをコピーする結果を右クリックし、   コピー / 参照   をクリックします。

2. コピー   ウィンドウで、必要なパスまたは参照を選択します。

Procedure: プロジェクトの検索文字列を置き換える

1. `Ctrl+Shift+R` (Windows), `⌘ ⇧ R` (macOS), `⌃ ⇧ R` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ R` (macOS System Shortcuts), `Ctrl+Shift+R` (XWin), `Ctrl+Shift+R` (GNOME), `Ctrl+Shift+R` (KDE), `Ctrl+Shift+R` (Emacs), `Ctrl+Shift+R` (Sublime Text), `Ctrl+Shift+R` (Sublime Text (macOS)), `⌘ ⌥ ⇧ F` (Xcode), `Ctrl+Shift+H` (Visual Studio), `⌘ ⇧ H` (Visual Studio (macOS)), `Ctrl+Shift+H` (ReSharper), `⌘ ⇧ H` (ReSharper (macOS)), `Ctrl+Shift+R` (QtCreator), `Ctrl+Shift+R` (QtCreator (macOS)), `Ctrl+Shift+H` (NetBeans), `Ctrl+Shift+R` (Eclipse), `Ctrl+Shift+R` (Eclipse (macOS)) を押して   パス内置換   ダイアログを開きます。

2. 上部のフィールドに検索文字列を入力します。 下部のフィールドに、置換文字列を入力します。

例: 大規模プロジェクトで変数名を新しい名前に置き換える場合は、変数が設定ファイルにも現れる可能性があるため、   名前変更   リファクタリングではなく   パス内置換   を使用してください。

3. 使用可能な   置換   コマンドのいずれかをクリックします。

Procedure: 検索を絞り込む

複数ファイル内検索   ダイアログでは、さまざまなオプションを使用して検索プロセスを調整できます。

* 単語   （ ![the Words icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.inline.exactWords.svg)）または   大文字・小文字を区別   （ ![Match case アイコン](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.inline.matchCase.svg)）などのオプションを選択して、プロジェクト内の正確な単語を検索するか、大文字と小文字を一致させます。

* ![正規表現アイコン](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.inline.regex.svg) が選択されている場合、CLion は特殊な正規表現シンボルを含むテキスト文字列を検索するときに、バックスラッシュ  `\`  で自動的にエスケープします。

> **Note:**
> 最初に文字列をコピー（ `Ctrl+C` (Windows), `⌘ C` (macOS), `⌘ C` (IntelliJ IDEA Classic (macOS)), `⌘ C` (macOS System Shortcuts), `Ctrl+C` (XWin), `Ctrl+C` (GNOME), `Ctrl+C` (KDE), `Ctrl+Insert` (Emacs), `Ctrl+C` (Sublime Text), `⌘ C` (Sublime Text (macOS)), `⌘ C` (Xcode), `Ctrl+C` (Visual Studio), `⌘ C` (Visual Studio (macOS)), `Ctrl+C` (ReSharper), `⌘ C` (ReSharper (macOS)), `Ctrl+C` (QtCreator), `⌘ C` (QtCreator (macOS)), `Ctrl+C` (NetBeans), `Ctrl+C` (Eclipse), `⌘ C` (Eclipse (macOS)) ）してから検索フィールドに貼り付け（ `Ctrl+V` (Windows), `⌘ V` (macOS), `⌘ V` (IntelliJ IDEA Classic (macOS)), `⌘ V` (macOS System Shortcuts), `Ctrl+V` (XWin), `Ctrl+V` (GNOME), `Ctrl+V` (KDE), `Shift+Insert` (Emacs), `Ctrl+Shift+V` (Sublime Text), `⌘ ⇧ V` (Sublime Text (macOS)), `⌘ V` (Xcode), `Ctrl+V` (Visual Studio), `⌘ V` (Visual Studio (macOS)), `Ctrl+V` (ReSharper), `⌘ V` (ReSharper (macOS)), `Ctrl+V` (QtCreator), `⌘ V` (QtCreator (macOS)), `Ctrl+V` (NetBeans), `Ctrl+V` (Eclipse), `⌘ V` (Eclipse (macOS)) ）した場合、正規表現シンボルは考慮されないことに注意してください。

regex  の詳細については、 [regex を使用した検索](tutorial-finding-and-replacing-text-using-regular-expressions.html)のドキュメントを参照してください。

* 検索をフィルタリングするには、 ![filter](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.filter.svg) アイコンをクリックします。 例: 検索をフィルタリングして、コメントを省略したり、コメント内でのみ検索したりすることができます。

* 検索を特定のフォルダーに制限するには、   ディレクトリ   を選択します。

さらに、検索の [定義済みスコープ](configuring-scopes-and-file-colors.html#predefined-scopes-list)のリストを提供する   スコープ   オプションを選択することもできます。 たとえば、プロジェクト内の開いているファイルのみに検索を制限できます。

タブなしで作業している場合、スコープ   最近表示したファイル   または   最近変更したファイル   オプションが役立つことがあります。 カスタム スコープも作成できます。   閲覧   アイコン（ ![省略記号アイコン](https://resources.jetbrains.com/help/img/idea/2026.3/app.general.ellipsis.svg)）をクリックすると、 [スコープ](configuring-scopes-and-file-colors.html) ダイアログが開きます。

Procedure: 特定のファイルタイプで検索する

ファイルマスク   オプションを使用して、検索を特定のファイルタイプに絞り込みます。 リストから既存のファイルタイプを選択したり、新しいファイルタイプを追加したり、追加のファイルマスク構文を追加して、特定のパターンのファイルタイプを検索することができます。

次の構文がサポートされています：

* `*` ：任意の数の任意のシンボル。 例えば、 `*.js` はすべての `.js` ファイルを含みます。または、 `test.*` は"test"という名前のすべてのファイルを含みます。

* `?` ：任意の単一文字。 例えば、 `test??.*` は命名に"test"の後に任意の 2 文字が続くすべてのファイルに一致します。例えば `testAB.js` 、 `test01.txt` などです。

* `,` ：パターン区切り文字。複数のパターンで検索を制限するために使用します。 例えば、 `*.js,????.ts` はすべての `.js` ファイルと、命名に 4 文字あるすべての `.ts` ファイルに一致します。

* `!` ：除外（これは単一の文字やパターンの一部ではなく、パターン全体に対して動作することに注意してください）。 例えば、 `*.js,!test*.js` は"test"で始まるものを除き、すべての `.js` ファイルに一致します。

1. 複数ファイル内検索   ダイアログで   ファイルマスク   チェックボックスを選択し、ファイルタイプのリストから必要なものを選択します。

CLion の検索は指定したタイプに制限されます。

2. リストに必要なファイルタイプが見つからない場合は、ファイルタイプを   ファイルマスク   フィールドに入力します。

例: ファイル内のみを検索するには、次の構文を使用します:  `*.cpp`  。

`*`  に加えて、他の [ワイルドカード(英語)](https://www.scootersoftware.com/v4help/index.html?file_masks.html)がサポートされています。 必要に応じて、区切り文字としてコンマを使用して複数のファイルタイプを指定します。

