- Jun 22, 2007
- Adding Text
- Cutting, Copying, and Pasting Text
- Dragging and Dropping Text
- Using Paste Special
- Applying Headings
- Applying Character Formats
- Changing Fonts and Font Sizes
- Making Your Own Font Lists
- Changing Font Color
- Applying Text Styles
- Using Preformatted Text
- Adding Line Breaks
- Indenting Text
- Aligning Text
- Working with Lists
- Setting List Properties
- Nesting Lists
- Inserting Special Characters
- Adding Automatic Dates
- Adding Horizontal Rules
- Finding and Replacing
- Finding Text with a Simple Search
- Performing Advanced Text Searches
- Finding and Replacing in Source Code
- Finding and Replacing with a Specific Tag
- Using Regular Expressions for Searching
- Checking Spelling
Performing Advanced Text Searches
An advanced text search allows you to do a more precise search by looking for text within (or outside of) particular HTML tags. You can further fine-tune the search by specifying particular attributes of the HTML tags.
Perhaps the most common example of why you would want to use such a search lies in the title of your Web pages. Whenever you create a new page in Dreamweaver, the page automatically gets the title "Untitled Document." If you forget to enter titles, you could end up with a bunch of pages on your site with the same "Untitled Document" name (it's easy to do: while writing this section, I found and fixed a page on my personal site that had been titled "Untitled Document" for four years!). A basic search and replace won't help, because "Untitled Document" is within the <title> tag of the pages, and a basic search only searches the body of a document. An advanced text search, which combines text and HTML searches, is the solution.
To perform an advanced text search:
Choose Edit > Find and Replace, or press Ctrl-F (Cmd-F).
The Find and Replace dialog appears.
- From the Find in pop-up menu, choose one of the options for the scope of your search.
From the Search pop-up menu, choose Text (Advanced).
The dialog changes, and adds the option to search tags (Figure 4.41).
Figure 4.41 The Text (Advanced) option allows you to search for text within HTML tags.
- In the Find field, type the word or phrase that you're looking for.
Choose either Inside Tag or Not Inside Tag from the pop-up menu next to the + and - buttons.
Inside Tag refers to text that is enclosed within a container tag, such as <p>...</p>.
- Choose an HTML tag from the Tag pop-up menu.
(Optional) If you want to narrow the search further by limiting the search to a particular attribute of the tag you chose in step 6, click the + button. If you do not, skip to step 12.
The attribute line is added to the dialog (Figure 4.42).
Figure 4.42 You can narrow your search further by adding one or more attributes to the tag search.
- (Optional) From the first pop-up menu in the attribute line, choose With Attribute or Without Attribute.
(Optional) Choose the attribute you want from the next pop-up menu.
Dreamweaver only shows the attributes for the tag you chose in step 6.
- (Optional) Set a comparison in the next pop-up menu, choosing from = (equals), < (less than), > (greater than), or != (not equals). These only work if the attribute's value is a numeric amount, such as the size attribute of the <font> tag, i.e., <font size="4">.
(Optional) In the next field (which is also a pop-up menu), type the value of the attribute. This can be a number or text.
Choose [any value] from the pop-up menu. This is useful when you want all tags with a particular attribute, but you don't care what the value of the attribute is.
- If you want to replace the found text, type the replacement word or phrase in the Replace field.
- Depending on what you want to do, click Find Next, Find All, Replace, or Replace All.