Go to the first, previous, next, last section, table of contents.


4 GNU Operators

Following are operators that GNU defines (and POSIX doesn't).

4.1 Word Operators

The operators in this section require Regex to recognize parts of words. Regex uses a syntax table to determine whether or not a character is part of a word, i.e., whether or not it is word-constituent.

4.1.1 Non-Emacs Syntax Tables

A syntax table is an array indexed by the characters in your character set. In the ASCII encoding, therefore, a syntax table has 256 elements. Regex always uses a char * variable re_syntax_table as its syntax table. In some cases, it initializes this variable and in others it expects you to initialize it.

4.1.2 The Match-word-boundary Operator (\b)

This operator (represented by `\b') matches the empty string at either the beginning or the end of a word. For example, `\brat\b' matches the separate word `rat'.

4.1.3 The Match-within-word Operator (\B)

This operator (represented by `\B') matches the empty string within a word. For example, `c\Brat\Be' matches `crate', but `dirty \Brat' doesn't match `dirty rat'.

4.1.4 The Match-beginning-of-word Operator (\<)

This operator (represented by `\<') matches the empty string at the beginning of a word.

4.1.5 The Match-end-of-word Operator (\>)

This operator (represented by `\>') matches the empty string at the end of a word.

4.1.6 The Match-word-constituent Operator (\w)

This operator (represented by `\w') matches any word-constituent character.

4.1.7 The Match-non-word-constituent Operator (\W)

This operator (represented by `\W') matches any character that is not word-constituent.

4.2 Buffer Operators

Following are operators which work on buffers. In Emacs, a buffer is, naturally, an Emacs buffer. For other programs, Regex considers the entire string to be matched as the buffer.

4.2.1 The Match-beginning-of-buffer Operator (\`)

This operator (represented by `\`') matches the empty string at the beginning of the buffer.

4.2.2 The Match-end-of-buffer Operator (\')

This operator (represented by `\'') matches the empty string at the end of the buffer.


Go to the first, previous, next, last section, table of contents.