Word

Type

Text

Syntax

Word: "regular_expression"

"regular_expression"

A macro string specifying a UNIX-syntax regular expression that matches a word.

The Word switch specifies a case-sensitive UNIX regular expression that matches a word. The Unixre and Case switches are ignored.

The Word switch accepts a TOOLS.INI macro string. The string can use escape sequences to represent nonprintable ASCII characters. Note that backslashes (\) must be doubled within a macro string.

The Word switch is used by functions that operate on words: Mword, Pword, Pwbhelp, right-clicking the mouse for Help, and double-clicking the mouse to select a word.

Default

Word:"[a-zA-Z0-9_$]+"

The default value mimics the behavior of PWB 1.x.

Examples

The Word switch can be used to change the definition of a word. The following examples show some useful word definitions.

The following setting works the same way as the default setting, except that Pword and Mword stop at the end of a line:

Word:"\\{[a-zA-Z0-9_$]+\\!$\\}"

The default setting of the Word switch matches Microsoft C/C++ identifiers and unsigned integers. To restrict the definition of a word to match the ANSI C standard for identifiers, you would use the setting:

Word:"[a-zA-Z_][a-zA-Z0-9_]*"

Another useful setting is to define a word as a contiguous stream of nonspace characters:

Word:"[^ \t]+"

The following Word setting defines a word as an identifier or unsigned integer, a stream of white space, a stream of other characters, or the beginning or end of the line. This causes the word-movement functions to stop at each boundary, and allows a double-click to select white space.

Word:"\\{[a-zA-Z0-9_$]+\\![ ]+\\![^a-zA-Z0-9_$]+\\!$\\!^\\}"