Keyword Expressions

A keyword expression search is similar to an Internet search engine query. Source Insight searches the project for occurrences of a set of keywords that appear within a specified number of lines. The Lines of Context text box indicates the maximum distance the keyword terms can be from each other to qualify as a match.

For example, if you typed “cat food”, then Source Insight will search for occurrences of “cat” and “food” within X lines of each other.

There is an implicit logical-AND operator between keywords. That is, if you type more than one keyword, the both keywords must be present to qualify as a match. You can include other Boolean operations as well. The following table lists the operators available:

Table 5.3: Keyword Search Operators

Operator

Example

Action

AND or +

cat and dog

Both terms must be present.

OR

cat or dog

Either term must be present

NOT
or –
or !

-cat

The term must not be present

=

=Betty

Case sensitive match

? “regexp”

? “^Ich”

Term is a regular expression

You can also group expressions using parentheses. For example:

(cat or kitty) and food
(file or buffer) and (save or write) and !error