MPE/iX Shell and Utilities Reference Manual, Vol 2
regexp(3) MPE/iX Shell and Utilities regexp(3)
[:punct:] Any printable character that is not white space or al-
phanumeric.
[:cntrl:] Any non-printable character.
For example, given the character class expression
[:alpha:]
you need to enclose the expression within another set of square brackets, as
in:
/[[:alpha:]]/
f) Character ranges are specified by a dash (–) between two characters, or col-
lating sequences. This indicates all character or collating sequences which
collate between two characters or collating sequences. The range does not
refer to the native character set. For example, in the
POSIX locale, [a-z]
means all lowercase letters, even if they don’t agree with the binary
machine ordering. However, since many other locales do not collate in this
manner, ranges should not be used in Strictly Conforming
POSIX.2 Applica-
tions. A collating sequence may explicitly be an endpoint of a range; for ex-
ample, [[.ch.]-[.ll.]] is valid; however equivalence classes or
character classes may not: [[=a=]-z] is illegal.
\ This character is used to turn off the special meaning of metacharacters. For ex-
ample, \. only matches a dot character. Note that \\ matches a literal \ character.
Also note the special case of ‘\d’ described later.
\d For d representing any single decimal digit (from 1 to 9), this pattern is equivalent to
the string matching the dth expression enclosed within the () characters (or \(\)
for some commands) found at an earlier point in the regular expression.
Parenthesized expressions are numbered by counting ( characters from the left.
Constructs of this form can be used in the replacement strings of substitution com-
mands (for example, the s command in Ex, or the sub function of awk), to stand for
constructs matched by parts of the regular expression. For example, in the following
Ex command
s/\(.*\):\(.*\)/\2:\1/
the \1 stands for everything matched by the first \(.*\) and the \2 stands for ev-
erything matched by the second. The result of the command is to swap everything
before the : with everything after.
3-34 Miscellaneous Information