Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

ex(1) OSS Shell and Utilities Reference Manual
^ (circumflex)
When it appears at the beginning of the pattern, matches the beginning
of a line. For example, ˆabc matches the string abc if it is found at the
beginning of a line.
$ (dollar sign)
When it appears at the end of a pattern, matches the end of a line. It is
equivalent to /\n. For example, abc$ matches the string abc if it is
found at the end of a line.
<<EOF>>
Matches an End-of-File.
<x> (angle bracket)
Identies a state name (see earlier description of state) and can appear
only at the beginning of a pattern. For example, <done><<EOF>>
matches an End-of-File, but only if it is in the state done.
In addition, the following rules apply for bracket expressions:
Equivalence class expressions
These represent the set of collating elements in an equivalence
class and are enclosed within bracket-equal delimiters ( [= =] ).
An equivalence class generally is designed to deal with primary-
secondary sorting; that is, for languages like French that dene
groups of characters as sorting to the same primary location, and
then have a tie-breaking, secondary sort. For example, if a, à, and
â belong to the same equivalence class, then [[=a=]b], [[=à=]b],
and [[=â=]b] are each equivalent to [aàâb].
Character class expressions
These represent the set of characters in the current locale belong-
ing to the named ctype class. These are expressed as a ctype class
name enclosed in bracket-colon delimiters ([: :]).
In the C or OSS locale, the following character class expressions
are supported: [:alpha:], [:upper:], [:lower:], [:digit:],
[:alnum:], [:xdigit:], [:space:], [:print:], [:punct:], [:graph:],
and [:cntrl:].
Other locales may dene additional character classes.
Letters and digits never have special meanings. A character such as ˆ or -, which
has a special meaning in particular contexts, refers simply to itself when found
outside that context. Spaces and tabs must be escaped to appear in a regular
expression; otherwise they indicate the end of the expression.
action Each pattern in a rule has a corresponding action, which can be any arbitrary C
statement. The pattern ends at the rst nonescaped white space character; the
remainder of the line is its action. If the action is empty, then when the pattern is
matched, the input that matched it is discarded.
If the action contains a {, then the action scans till the balancing } is found, and
the action may cross multiple lines. Using a return statement in an action returns
from yylex().
An action consisting solely of a vertical bar (|) means same as the action for the
next rule.
3148 Hewlett-Packard Company 527188-003