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

User Commands (d - f)
flex(1)
[] (brackets)
Represent a character class in the enclosed range ([.-.]) or the enclosed
list ([...]). The dash character ( - ) is used to define a range of characters
from the ASCII value or the 8-bit class of the character that comes
before the dash to the ASCII value or the 8-bit class of the character that
follows the dash. For example, [abcx-z] matches a, b, c, x, y,orz.
The circumflex ( ˆ ), when it appears as the first character in a character
class, indicates the complement of the set of characters within that class.
For example, [ ˆabc] matches any character except a, b,orc, including
special characters like newline. Similarly, [ ˆa-zA-Z] is any character
that is not a letter.
()(parentheses)
Group regular expressions. For example, (ab) is considered as a single
regular expression.
{}(braces)
When enclosing numbers, indicate a number of consecutive occurrences
of the expression that comes before it. For example, (ab){1,5} indicates
a match for from 1 to 5 occurrences of the string ab.
When enclosing a name, the name represents a regular expression
defined in the definitions section. For example, {digit} will be replaced
with the defined regular expression for digit. Note that the expansion
takes place as if the definition were enclosed in parentheses.
. (dot) Matches any single character except newline.
? (question mark)
Matches zero or one of the preceding expressions. For example, ab?c
matches both ac and abc.
* (asterisk)
Matches zero or more of the preceding expressions. For example, a* is
zero or more consecutive a characters. The utility of matching zero
occurrences is more obvious in complicated expressions. For example,
the expression [A-Za-z][A-Za-z0-9]* indicates all alphanumeric strings
with a leading alphabetic character, including strings that are only one
alphabetic character.
+ (plus sign)
Matches one or more of the preceding expressions. For example,
[a-z]+ is all strings of lowercase letters.
xy (concatenation)
Matches the expression x followed by the expression y.
(vertical bar)
Matches either the preceding expression or the following expression.
For example, abcd matches either ab or cd.
x/y (slash)
Matches expression x only if expression y (trailing context) immediately
follows it. For example, ab/cd matches the string ab but only if fol-
lowed by cd. Only one trailing context is permitted per pattern.
527188-003 Hewlett-Packard Company 3−147