AWS Cloud9 is no longer available to new customers. Existing customers of
AWS Cloud9 can continue to use the service as normal.
Learn more"
Finding and Replacing Text in the AWS Cloud9 Integrated Development Environment (IDE)
You can use the find and replace bar in the AWS Cloud9 IDE to find and replace text in a single file or multiple files.
Find Text in a Single File
-
Open the file you want to find text in. If the file is already open, choose the file's tab to make the file active.
-
On the menu bar, choose Find, Find.
-
In the find and replace bar, for Find, type the text you want to find.
-
To specify additional find options, see Find and Replace Options.
-
If there are any matches, 0 of 0 in the Find box changes to non-zero numbers. If there are any matches, the editor goes to the first match. If there is more than one match, to go to the next match, choose the right arrow in the Find box or choose Find, Find Next on the menu bar. To go to the previous match, choose the left arrow in the Find box or choose Find, Find Previous on the menu bar.
Replace Text in a Single File
-
Open the file you want to replace text in. If the file is already open, choose the file's tab to make the file active.
-
On the menu bar, choose Find, Replace.
-
In the find and replace bar, for Find, type the text you want to find.
-
For Replace With, type the text you want to replace the text in Find with.
-
To specify additional find and replace options, see Find and Replace Options.
-
If there are any matches, 0 of 0 in the Find box changes to non-zero numbers. If there are any matches, the editor goes to the first match. If there is more than one match, to go to the next match, choose the right arrow in the Find box or choose Find, Find Next on the menu bar. To go to the previous match, choose the left arrow in the Find box or choose Find, Find Previous on the menu bar.
-
To replace the current match with the text in Replace With and then go to the next match, choose Replace. To replace all matches with the text in Replace With, choose Replace All.
Find Text in Multiple Files
-
On the menu bar, choose Find, Find in Files.
-
In the find and replace bar, for Find, type the text you want to find.
-
To specify additional find options, see Find and Replace Options.
-
In the box to the right of the Find button (the box with
*.*, -.*
), type any set of files to include or exclude in the find. For example:-
Blank,
*
, or*.*
: Find all files. -
my-file.txt
: Find only the file namedmy-file.txt
. -
my*
: Find only files with file names starting withmy
. -
my*.txt
: Find only files with file names starting withmy
and that have the file extension.txt
. -
my*.htm*
: Find all files with file names starting withmy
and a file extension starting with.htm
. -
my*.htm, my*.html
: Find all files with file names starting withmy
and the file extension.htm
or.html
. -
-my-file.txt
: Do not search the file namedmy-file.txt
. -
-my*
: Do not search any files starting withmy
. -
-my*.htm*
: Do not search any files with file names starting withmy
and a file extension starting with.htm
. -
my*.htm*, -my*.html
: Search all files with file names starting withmy
and a file extension starting with.htm
. However, do not search any files with file names starting withmy
and a file extension of.html
.
-
-
In the drop-down list next to the preceding box, choose one of the following to further restrict the find to only specific locations:
-
Environment: Find only files in the Environment window.
-
Project (excludes .gitignore'd): Find any file in the environment, except for files or file types listed in the
.gitignore
file in the environment, if a.gitignore
file exists. -
Selection:: Find only files that are currently selected in the Environment window.
Note
To further restrict the find to only a single folder, choose a folder in the Environment window and then choose Selection. Alternatively, you can right-click the folder in the Environment window, and then choose Search In This Folder on the context menu.
-
Favorites: Find only files in the Favorites list in the Environment window.
-
Active File: Find only the active file.
-
Open Files: Find only files in the Open Files list in the Environment window.
-
-
Choose Find.
-
To go to a file containing matches, double-click the file name on the Search Results tab. To go to a specific match, double-click the match in the Search Results tab.
Replace Text in Multiple Files
-
On the menu bar, choose Find, Find in Files.
-
In the find and replace bar, for Find, type the text you want to find.
-
To specify additional find options, see Find and Replace Options.
-
In the box to the right of the Find button (the box with
*.*, -.*
), type any set of files to include or exclude in the find. For example:-
Blank,
*
, or*.*
: All files. -
my-file.txt
: Only the file namedmy-file.txt
. -
my*
: Only files with file names staring withmy
. -
my*.txt
: Only files with file names starting withmy
and that have the file extension.txt
. -
my*.htm*
: All files with file names starting withmy
and a file extension starting with.htm
. -
my*.htm, my*.html
: All files with file names starting withmy
and the file extension.htm
or.html
. -
-my-file.txt
: Do not search the file namedmy-file.txt
. -
-my*
: Do not search any files starting withmy
. -
-my*.htm*
: Do not search any files with file names starting withmy
and a file extension starting with.htm
. -
my*.htm*, -my*.html
: Search all files with file names starting withmy
and a file extension starting with.htm
. However, do not search any files with file names starting withmy
and a file extension of.html
.
-
-
In the drop-down list next to the preceding box, choose one of the following to further restrict the find to only specific locations:
-
Environment: Only files in the Environment window.
-
Project (excludes .gitignore'd): Any file in the environment, except for files or file types listed in the
.gitignore
file in the environment, if a.gitignore
file exists. -
Selection: /: Only files that are currently selected.
-
Favorites: Only files in the Favorites list in the Environment window.
-
Active File: Only the active file.
-
Open Files: Only files in the Open Files list in the Environment window.
-
-
For Replace With, type the text you want to replace Find with.
-
Choose Replace.
Note
The replace operation happens immediately across all files in scope. This operation cannot be easily undone. If you want to see what will be changed before you start the replace operation, choose Find instead.
-
To go to a file containing replacements, double-click the file name in the Search Results tab. To go to a specific replacement, double-click the replacement in the Search Results pane.
Find and Replace Options
Choose any of the following buttons on the find and replace bar to modify find and replace operations.
![Searching in a single file](/images/cloud9/latest/user-guide/images/ide-search-single.png)
![Searching in multiple files](/images/cloud9/latest/user-guide/images/ide-search-multiple.png)
-
Regular Expressions: Find text matching the specified regular expression in Find or Find in Files. See Writing a regular expression pattern
in the JavaScript Regular Expressions topic on the Mozilla Developer Network. -
Match Case: Find text matching the specified casing in Find or Find in Files.
-
Whole Words: Use standard word character rules to find text in Find or Find in Files.
-
Wrap Around: For a single file only, do not stop at the end or beginning of the file when going to the next or previous match.
-
Search Selection: For a single file only, find only in the selection.
-
Show in Console: For multiple files, show the Search Results tab in the Console instead of the active pane.
-
Preserve Case: For a single file only, preserve casing as applicable when replacing text.