Use Dreamweaver’s powerful find and replace features to find and replace code, text, or tags (with or without attributes) within a current document, folder, site, or across all open documents.
You can also use powerful pattern-matching algorithms (regular expressions) for sophisticated find-and-replace operations.
Here are some of the things you can find and replace:
- Tags, attributes, and text within code
- Text within a selection, or multiple selections
- Text across multiple documents, open documents, a folder, a site, or restrict the search to the currently open document
- Use regular expressions in your search strings
You can search for text, tags, and attributes even if there is no open document in Dreamweaver.
-
In an open document, click Find > Find in Current Document, or press Ctrl + F (on Windows), or Cmd+F (on Mac) to open the Quick Find bar docked at the bottom of your current document.
If you want to also replace text, click Find > Replace in Current Document, or press Ctrl + H (on Windows), or Cmd + Alt + F (on Mac) to open the Quick Find and Replace bar.
-
Use the following filters to expand or limit your search:
- Match Case: Limits the search to code/tag/text that exactly matches the case of the text you want to find. For example, if you search for the brown derby, you will not find The Brown Derby.
- Use Regular Expressions: Causes certain characters and short strings (such as ?, *, \w, and \b) in your search string to be interpreted as regular expression operators. For example, a search for the b\w*\b dog will match both the black dog and the barking dog.
- Match Whole Word: Limits the search to text that matches one or more complete words
- Ignore White Spaces: Treats all whitespace as a single space for the purposes of matching. For example, with this option selected, "this text" would match "this text" but not "thistext". This option is not available when the Use Regular Expressions option is selected; you must explicitly write your regular expression to ignore whitespace. Tags do not count as whitespace.
- Find in Selected Text: Confines the search to the text that’s currently selected in the active document. The selected text can be a single block of text, or multiple selections of text in different places in the currently opened document. When you are searching within selected text, the found search terms are not highlighted in the document. Click Find All to display the search results in the Search panel.
-
To replace found text or tags, type in the Replace field, then click Replace or Replace All.
To walk through the found instances of the page, and replace them individually, click Replace, and use the next and previous arrows to navigate to other instances of the search term within the document.
To replace all instances of the search term instantly, click Replace All. Dreamweaver replaces all the found instances, and provides a report of all the terms found and replaced.
-
Select Find > Find and Replace in Files or press Ctrl + Shift + F (on Windows), or Cmd + Shift + F (on Mac) to open the Find and Replace dialog box.
Opomba:
When Find and Replace in Files is opened for the first time, the Search in Entire Current Local Site is the default option. If you make a different selection, Dreamweaver remembers your selection and makes your selected option the default option.
-
Type in the text in the Find text field and select any of the following options in the drop-down list:
- Current Document - Dreamweaver searches for the specified phrase in the document that is currently in focus.
- Open Documents - Dreamweaver searches for the specified phrase in all open documents.
- Folder - Dreamweaver searches for the specified phrase in all the files located within the specified folder.
- Selected Files in Site - Dreamweaver searches for the specified phrase in files that are selected from a site in the Files panel.
- Entire Current Local Site - Dreamweaver searches for the specified phrase in the current site that you are working on.
-
Use the following filters to expand or limit your search:
- Match Case: Limits the search to text that exactly matches the case of the text you want to find. For example, if you search for the brown derby, you will not find The Brown Derby.
- Use Regular Expressions: Causes certain characters and short strings (such as ?, *, \w, and \b) in your search string to be interpreted as regular expression operators. For example, a search for the b\w*\b dog will match both the black dog and the barking dog.
- Match Whole Word: Limits the search to text that matches one or more complete words
- Ignore White Spaces: Treats all whitespace as a single space for the purposes of matching. For example, with this option selected, "this text" would match "this text" but not "thistext". This option is not available when the Use Regular Expressions option is selected; you must explicitly write your regular expression to ignore whitespace. Tags do not count as whitespace.
- Search Text Only: Searches for specific text strings in the text of the document. A text search ignores any HTML that interrupts the string. For example, a search for "head" would match instances of head in the text only. The search ignores all instances of <head> and </head>.
Opomba:
The Search Text Only filter is disabled in the Advanced tab in the Find and Replace dialog.
-
- To find all instances of the specified text, select Find All. Dreamweaver opens the Search Results panel. If you are searching a single document, Find All displays all occurrences of the search text or tags, with some surrounding context. If you are searching a directory or site, Find All displays a list of documents that contain the tag.
- To replace found text or tags, type in text in the Replace field, and click Replace or Replace All.
- To walk through the found instances of the page, and replace them individually, click Replace, and use the next and previous arrows to navigate to other instances of the search term.
- To replace all instances of the search term instantly, click Replace All. Dreamweaver replaces all the found instances, and provides a report of all the terms found and replaced in the Search Results panel.
- To first see the Find results before replacing them, select Replace All and Exceptions. When this option is specified, the Find results are displayed in the Search Results panel. You can then deselect the instances you do not want to be replaced.
You can search for specific tags, attributes, and attribute values. For example, you can search for all img tags that have no Alt attribute.
You can also search for specific text strings that are within or not within a set of container tags. For example, you can search for the word Untitled contained in a title tag to find all the untitled pages on your site.
-
In the Advanced tab, select one of the following Find in options:
- Current Document - Dreamweaver searches for the specified phrase in the document that is currently open
- Open Documents - Dreamweaver searches for the specified phrase in all open documents
- Folder - Dreamweaver searches for the specified phrase in all the files located within the specified folder
- Selected Files in Site - Dreamweaver searches for the specified phrase in files that are selected in the Files panel.
- Entire Current Local Site - Dreamweaver searches for the specified phrase in the current site that you are working on.
-
Do one of the following:
- To find all instances of the specified text, select Find All. Dreamweaver opens the Search Results panel. If you are searching a single document, Find All displays all occurrences of the search text or tags, with some surrounding context. If you are searching a directory or site, Find All displays a list of documents that contain the tag.
- To replace found text or tags, type in text in the Replace field, and click Replace or Replace All.
- To walk through the found instances of the page, and replace them individually, click Replace, and use the next and previous arrows to navigate to other instances of the search term.
- To replace all instances of the search term instantly, click Replace All. Dreamweaver replaces all the found instances, and provides a report of all the terms found and replaced in the Search Results panel.
- To first see the Find results before replacing them, select Replace All and Exceptions. When this option is specified, the Find results are displayed in the Search Results panel. You can then deselect the instances you do not want to be replaced.
Double-click a search result in the Search Results panel and Dreamweaver navigates to its location and places the cursor at the location of the text.
Select Find > Find and Replace.
To save queries, click the Save icon as shown in the Find and Replace dialog and choose the destination to save the file as .dwr file.
To load queries, click the Load icon and choose the .dwr query file from your computer.
By default, saving and loading search queries is not enabled in Dreamweaver CC 2017 and 2018 versions. However, if you really need to be able to save and load search queries, then complete the following steps to enable this feature.
-
On Windows:
- Open the Registry Editor - In the Start Menu, either in the Run Box or the Search box, type regedit and press Enter.
- Navigate to the following location: HKEY_CURRENT_USER\SOFTWARE\Adobe\Dreamweaver CC 2017\Advanced Find And Replace
- Right click and create a new string value with ShowHiddenOptions=TRUE.
- Close the Registry Editor.
Opomba:
If you cannot find Advanced Find and Replace in your Windows Registry Editor, clear your Dreamweaver preferences, and open Dreamweaver again.