PATTERNS -- Regular Expression Syntax and Usage 83/08/01
This file summarizes the regular expression syntax used for pattern matching
in Apollo-supplied software. Regular expression syntax is described in
detail in the Display Manager chapter of the "DOMAIN System Command Reference
Manual."
Character: Matches:
% Beginning of line, when at beginning of expression.
Otherwise, matches %.
$ End of line, when at end of expression. Otherwise,
matches $.
? Any single character except NEWLINE.
* Zero or more occurrences of preceding expression.
As first character in expression, matches *.
[string] One occurrence of any single character in 'string'.
[~string] One occurrence of any single character EXCEPT those
in 'string' and NEWLINE.
You may specify a range of characters or digits in
'string' as a-z, A-Z, or 0-9. Subsets, such as M-T,
are valid. Most special characters lose their special
meanings when included in 'string'. If not the first
character after [, the tilde specifies a ~ character.
To include a literal ], ~, -, or @ in 'string', precede
it with an @.
@f Form feed.
@n NEWLINE.
@t Tab.
@c Special character 'c', e.g. @$, @%.
{expr} Tags 'expr' for use in substitution string. Substitution
strings are used in the DM and Shell ED commands
S (SUBSTITUTE), and by the Shell CHPAT (CHANGE_PATTERN)
and EDSTR (EDIT_STREAM) commands.
Refer to tagged expressions as @1, @2, etc.
any other character Literal character.