MPE/iX Shell and Utilities Reference Manual, Vol 2
vi(1) MPE/iX Shell and Utilities vi(1)
[string] matches any of the characters in the class of characters defined by string. For ex-
ample, [aeiouy] matches any of the vowels. You can put a range of characters in
a class by specifying the first and last characters of the range, with a hyphen (-) be-
tween them. For example, in
ASCII [A–Za–z] matches any upper or lowercase
letter. If the first character of a class is the caret (ˆ), the class matches any character
not specified inside the square brackets. Thus, in
ASCII [a–z_][ˆ0–9] matches a
single alphabetic character or the underscore, followed by any non-numeric charac-
ter.
\(...\) (escaped parentheses) may surround a set of characters in the pattern. See the discus-
sion of the \n replacement pattern, that appears under Replacement Pattern Summary,
to find the meaning of this construct. This is not affected by the setting of the vari-
able magic (see the Set Option Variables section).
˜ matches the replacement part of the last substitute command.
Replacement Pattern Summary
& is replaced by the entire string of matched characters.
˜ is replaced by the entire replacement pattern from the last substitute.
\n is replaced by the string that matched the nth occurrence of a \( ... \) in the regular ex-
pression. For example, consider
s/\([a-zA-Z]*\)our/\1or/
The \1 represents the string that matched the regular expression
\([a-zA-Z]*\). Thus the previous command might change the word colour to
color.
\u turns the next character in the replacement to uppercase.
\l turns the next character in the replacement to lowercase.
\U turns subsequent characters in the replacement to uppercase.
\L turns subsequent characters in the replacement to lowercase.
\E, \e turns off the effects of \U or \L.
1-662 Commands and Utilities