Searching for a Pattern

Related Topics:

Pattern Search and Source Browsing Pattern Search Mode
Browsing Source Code in the Editor

A pattern search is a search for any text string, including your comments.

To start a pattern search from the WorkShop Main Window:

1. Choose Browse Pattern Search.

If the directory shown in the Browsing Window header is not the directory where your source code resides, see Changing Browsing Directories. To search multiple directories, see Searching Multiple Directories.

2. In the Pattern text box, type the string you want to find.

The string can be any text string, including your comments. For example, typing simulat in the Pattern text box returns all matches that contain simulat, including traffic_simulation(). Typing \<simulat returns only those strings that begin with simulat. See Special Characters in Pattern Search and Source Browsing Modes and the regexp man page for more information and examples.

To search for a text string displayed in an editor window, copy the text in the editor window, and paste it into the Browsing window's Pattern text box.

3. If desired, type a filter in the Files text box.

If you are programming in C or C++, this step is not necessary.

The default filter searches for all files ending in .c (C source files),.cc (C++ source files), or .h (C and C++ header files). Restrict the types of files searched by changing the default file types in the Files text box.

4. Press Return.

5. To display a match's source in the editor window, click on the match (see Viewing the Source of a Pattern Search Match).

6. To display more matches, choose Query Next Match or Query Previous Match.

To start a pattern search from the Browsing Window:

1. Click the Pattern Search radio button.

2. In the Pattern text box, type the string you want to find.

The string can be any text string, including your comments. For example, typing simulat in the Pattern text box returns all matches that contain simulat, including traffic_simulation(). Typing \<simulat returns only those strings that begin with simulat. See Special Characters in Pattern Search and Source Browsing Modes and the regexp man page for more information and examples.

To search for a text string displayed in an editor window, copy the text in the editor window, and paste it into the Browsing window's Pattern text box.

3. If desired, type a filter in the Files text box.

If you are programming in C or C++, this step is not necessary.

The default filter searches for all files ending in .c (C source files),.cc (C++ source files), or .h (C and C++ header files). Restrict the types of files searched by changing the default file types in the Files text box.

4. Press Return.

5. To display a match's source in the editor window, click on the match (see Viewing the Source of a Pattern Search Match).

6. To display more matches, choose Query Next Match or Query Previous Match.