Export (0) Print
Expand All

Set HTML rules for finding text

The Find and Replace dialog box supports HTML rules in searches and has advanced HTML tag and attribute options. By using HTML rules in your search, you can determine where and under what conditions to search your code. For example, you can create an HTML rule to search text only inside a tag. Text outside of the tag would be excluded from search results.

To set HTML rules for finding tags

  1. Do one of the following:

    • To search within a single page, open the page.

    • To search all pages in a site, open the site.

    • To search in one or more pages in a site, in either the Folder List task pane or the Web Site view, select the pages that you want to search.

    • To search in one or more pages in a site, open the pages that you want to search.

  2. On the Edit menu, do one of the following:

    • To find but not replace text, click Find.

    • To find and replace text, click Replace.

  3. In the Find and Replace dialog box, click HTML Rules.

  4. In the HTML Rules dialog box, do any of the following:

    • To add a rule, click New rule. In the New rule box, type or select the tag you want to find. In the Replace action box, select a criterion. Set the options for the criterion.

    • To delete a rule, select the rule and click Delete rule.

    • To delete all rules, click Delete all.

      Cc295353.alert_tip(en-us,Expression.10).gifTip:

      To remove all HTML rules, in the Find and Replace dialog box, click Clear rules.

      Use this

      To do this

      With Attribute

      Find the text or tag only if it is in a tag with an attribute. For example, you can search for all instances of "Arial" and limit your search to only those tags that include a specific attribute.

      Without Attribute

      Find the text or tag only if it is in a tag without an attribute. For example, you can search for all instances of "p" and limit your search to only those tags that do not include a specific attribute.

      Containing

      Find the text or tag only if it is in another tag or text that you specify. For example, you can search for all instances of the font <font> tag that are nested in a bold <b> tag.

      Not Containing

      Find the text or tag only if it is not in another tag or text that you specify. For example, you can search for all instances of the table <table> tag that are not nested in another tag.

      Inside Tag

      Find the text or tag only if it is in a tag that you specify. For example, you can search for all instances of the word "font" and all instances of the font <font> tag will be in your search results.

      Not Inside Tag

      Find the text or tag only if it is not in a tag that you specify. For example, you can search for all instances of the word "font" and instances of the font <font> tag will not be in your search results.

Community Additions

ADD
Show:
© 2014 Microsoft