|
vgrindefs uses regular expressions similar to those of ex(1)
and lex(1). The characters `^', `$', `:', and `\' are
reserved characters and must be `quoted' with a preceding \ if they are to be included as normal characters. The metasymbols and their meanings are:
-
$
- The end of a line
-
^
- The beginning of a line
-
\d
- A delimiter (space, tab, newline, start of line)
-
\a
- Matches any string of symbols (like `.*' in lex)
-
\p
- Matches any identifier. In a procedure definition (the `pb' capability) the string that matches this symbol is used as the procedure
name.
-
()
- Grouping
-
|
- Alternation
-
?
- Last item is optional
-
\e
- Preceding any string means that the string will not match an input string if the input string is preceded by an escape character (\).
This is typically used for languages (like C) that can include the string delimiter in a string by escaping it.
Unlike other regular expressions in the system, these match words and not characters. Hence something like `(tramp|steamer)flies?' would match `tramp', `steamer', `trampflies', or `steamerflies'.
Contrary to some forms of regular expressions, vgrindef alternation binds very tightly. Grouping parentheses are likely to be necessary in expressions involving alternation.
|