Dreamweaver CS4 Resources
|
Search for and replace text
You can use the Find And Replace
command to search for text and for HTML tags and attributes in a
document or a set of documents. The Search panel, in the Results
panel group, shows the results of a Find All search.
Note: To
search for files in a site, use different commands: Locate In Local
Site and Locate In Remote Site.
Search for and replace text- Open the document to search in, or select
documents or a folder in the Files panel.
- Select Edit > Find And Replace.
- Use the
Find In option to specify which files to search:
- Selected Text
- Confines the search to the text that’s currently selected
in the active document.
- Current Document
- Confines the search to the active document.
- Open Documents
- Searches all documents that are currently open.
- Folder
- Confines the search to a specific folder. After choosing
Folder, click the folder icon to browse to and select a folder to
search.
- Selected Files In Site
- Confines the search to the files and folders that are currently
selected in the Files panel.
- Entire Current Local Site
- Expands the search to all the HTML documents, library
files, and text documents in the current site.
- Use
the Search pop‑up menu to specify the kind of search you want to perform:
- Source Code
- Searches for specific text strings in the HTML source
code. You can search for specific tags using this option, but the
Specific Tag search provides a more flexible approach to searching
for tags.
- Text
- 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 the black dog would
match both the black dog and the <i>black</i>
dog.
- Text (Advanced)
- Searches for specific text strings that are either within
or not within a tag or tags. For example, in a document that contains
the following HTML, searching for tries and
specifying Not Inside Tag and the i tag would find
only the second instance of the word tries: John
<i>tries</i> to get his work done on time, but he doesn’t
always succeed. He tries very hard. .
- Specific Tag
- Searches for specific tags, attributes, and attribute
values, such as all td tags with valign set
to top.
Note: Pressing Control+Enter or Shift+Enter
(Windows), or Control+Return, Shift+Return, or Command+Return (Macintosh),
adds line breaks within the text search fields, allowing you to
search for a Return character. When performing such a search, deselect
the Ignore Whitespace Differences option if you’re not using regular expressions.
This search finds a Return character in particular, not simply the
occurrence of a line break; for instance, it doesn’t find a <br> tag
or a <p> tag. Return characters appear as
spaces in the Design view, not as line breaks.
- Use the following options to expand or limit the 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.
- Ignore Whitespace
- Treats all whitespace as a single space for the purposes
of matching. For example, with this option selected, this
text would match this text and 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. Note that <p> and <br> tags
do not count as whitespace.
- Match Whole Word
- Limits
the search to text that matches one or more complete words.
Note: Using
this option is equivalent to doing a regular-expression search for
a search string that starts and ends with \b, the word-boundary
regular expression.
- 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.
Note: If you are working in Code view and make
changes to your document, and try to find and replace anything other
than source code, a dialog box appears letting you know that Dreamweaver
is synchronizing the two views before doing the search.
- To search without replacing, click Find Next or Find
All:
- Find Next
- Jumps to and selects the next occurrence of the search
text or tags in the current document. If there are no more instances
of the tag in the current document, Dreamweaver proceeds
to the next document, if you are searching in more than one document.
- Find All
- Opens the Search panel in the Results panel group. 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, click Replace or Replace
All.
- When you’re finished, click Close.
Search again without displaying the Find And Replace dialog box Press F3 (Windows) or Command+G (Macintosh).
View a particular search result in context- Select Window > Results
to display the Search panel.
- Double-click a line in the Search panel.
If you’re searching the current file, the Document window
displays the line containing that search result.
If you’re
searching a set of files, the file containing that search result
opens.
Perform the same search again Click the Find And Replace button.
Stop a search in progress Click the Stop button.
Search for a specific tagUse the Find And Replace dialog box to search
for text or tags in a document, and to replace the found material
with other text or tags.
- Select Edit > Find And Replace.
- In the Search pop‑up menu, select Specific Tag.
- Select a specific tag or [any tag] from
the pop‑up menu next to the Search pop‑up menu, or type a tag name
in the text box.
- (Optional.) Limit the search with one of the following
tag modifiers:
- With Attribute
- Specifies an attribute that must be in the tag for it
to match. You can specify a particular value for the attribute or
select [any value].
- Without Attribute
- Selects an attribute that must not be in the tag for
it to match. For example, select this option to search for all img tags
with no alt attribute.
- Containing
- Specifies text or a tag that must be contained within
the original tag for it to match. For example, in the code <b><font
size="4">heading 1</font></b>, the font tag
is contained within the b tag.
- Not Containing
- Specifies text or a tag that must not be contained within
the original tag for it to match.
- Inside Tag
- Specifies a tag that the target tag must be contained
in for it to match.
- Not Inside Tag
- Specifies a tag that the target tag must not be contained
in for it to match.
- (Optional.) To limit the search further, click the Plus
(+) button and repeat step 3.
- If you didn’t apply any tag modifiers in steps 3 and
4, then click the Minus (-) button to remove the tag modifiers pop‑up
menu.
- If you want to perform an action when the tag is found
(such as removing or replacing the tag), select the action from
the Action pop‑up menu and, if applicable, specify any additional
information necessary to perform the action.
Search for specific text (Advanced)Use the Find and Replace dialog box to search
for text or tags in a document, and to replace the found material
with other text or tags.
- Select Edit > Find and Replace.
- In the Search pop‑up menu, select Text (Advanced).
- Enter text in the text field adjacent to the Search pop‑up
menu.
For example, type the word Untitled.
- Select Inside Tag or Not Inside Tag, and then select
a tag from the adjacent pop‑up menu.
For example, select Inside Tag and then title.
- (Optional.) Click the Plus (+) button to limit the search
with one of the following tag modifiers:
- With Attribute
- Specifies an attribute that must be in the tag for it
to match. You can specify a particular value for the attribute or
select [any value].
- Without Attribute
- Selects an attribute that must not be in the tag for
it to match. For example, select this option to search for all img tags
with no alt attribute.
- Containing
- Specifies text or a tag that must be contained within
the original tag for it to match. For example, in the code <b><font
size="4">heading 1</font></b>, the font tag
is contained within the b tag.
- Not Containing
- Specifies text or a tag that must not be contained within
the original tag for it to match.
- Inside Tag
- Specifies a tag that the target tag must be contained
in for it to match.
- Not Inside Tag
- Specifies a tag that the target tag must not be contained
in for it to match.
- (Optional.) To limit the search further, repeat step
4.
|