## CD-ROM Book Search Help

Copyright © 1998 Addison Wesley Longman.

- Preindexed and Exhaustive Searches
- Search Terms
  - Word Search
  - Regular Expressions
- Search Results

## Preindexed and Exhaustive Searches

You can search for a term either by using a pregenerated index of words in the book or by dynamically searching all the HTML files. The first type of search is a preindexed search and the second is an exhaustive search. Either search mode can be selected from the checkboxes on the search window.

A preindexed search will generally take a few seconds at most because it searches a much smaller number of words. A preindexed search will disregard articles, prepositions and other very common words as these are not indexed. The length of an exhaustive search will vary depending on the speed of your computer, your hard drive, and the Web browser you're using. If a preindexed search does not find what you're looking for, you should try an exhaustive search.

An exhaustive search will return only one instance of a page containing a match, although the page may contain more matches. To search for further matches on the page, use your browser's Find command. Additionally, in order to maximize the searches efficiency over raw HTML, an exhaustive search will not return matches to queries delimited by punctuation (e.g. "even though"). To search for a quote, or other punctuated term, simply search for the words.

## Search Terms

You can search for two different kinds of expressions, which can be selected from the checkboxes on the search window:

- Words
- Regular Expressions

All searches are case insensitive. A word search looks only for exact matches of a word or list of words. A regular expression search tries to match a regular expression to a word.

## Word Search

A word search looks only for exact matches of a word. If multiple words are entered, the search engine will find only files that contain all of these words. Think of entering multiple word phrases as searching for that phrase. A word search is the same for both indexed and exhaustive searches. The only difference is that for an indexed search the order of the words is not important, but for an exhaustive search the words must be in the correct order.

Example:
Searching the phrase "yes bananas no have" will match a document that contains "yes we have no bananas" if you are doing an indexed search, but not an exhaustive search.

## Regular Expressions

A regular expression search tries to match a regular expression to a word. There are many different regular expression syntaxes, but today Larry Wall's Perl 4 regular expression syntax is the most common on the Internet, and therefore is the syntax supported. Perl 4 regular expressions are close cousins to egrep extended regular expressions, with a few differences.

The following Perl 4 regular expression features are supported:

- Alternatives separated by |
- Quantified atoms
  {n,m}
    Match at least n but not more than m times.
  {n,}
    Match at least n times.
  {n}
    Match exactly n times.
  *
    Match 0 or more times.
  +
    Match 1 or more times.
  ?
    Match 0 or 1 times.
- Atoms
  - regular expression within parentheses
  - a . matches everything except \n
  - a ^ is a null token matching the beginning of a string or line (i.e., the position right after a newline or right before the beginning of a string)
  - a $ is a null token matching the end of a string or line (i.e., the position right before a newline or right after the end of a string)
  - Character classes (e.g., [abcd]) and ranges (e.g., [a-z])
    - Special backslashed characters work within a character class (except for backreferences and boundaries)
    - \b is backspace inside a character class
  - Special backslashed characters

    \b | null token matching a word boundary (\w on one side and \W on the other)
    \B | null token matching a boundary that isn't a word boundary
    \n | newline
    \r | carriage return
    \t | tab
    \f | formfeed
    \d | digit [0-9]
    \D | non-digit [^0-9]
    \w | word character [0-9a-z_A-Z]
    \W | a non-word character [^0-9a-z_A-Z]
    \s | a whitespace character [ \t\n\r\f]
    \S | a non-whitespace character [^ \t\n\r\f]
    \xnn | hexadecimal representation of character
    \cD | matches the corresponding control character
    \nn or \nnn | octal representation of character
    \0 | matches null character
    Any other backslashed character matches itself

## Search Results

After you enter your search query and press enter or click the Search button, a list of results appears. The results are displayed as section headings by default. A section is either the title of the HTML page or the title of the page, followed by the section title of the part of the page satisfying the search query.

You can choose to display your results as sections, URLs, or both from the choice menu at the bottom left. Looking at the URLs is useful when you want to know exactly what file a result is in.

Note that an exhaustive search will return only one instance of a page containing a match, although there may be more than one. To find additional matches on the page, use your browser's Find command.

Clicking the Show button or double clicking on a list entry will display the parts of the HTML pages containing your results in your Web browser. If the files are not installed properly, you will get an error message.