
ex(1) | ex(1) |
+n, +[+]... | An offset relative to the current line or the preceding line speci®cation. + means for- |
ward; - means backward. For example, the forms .+3, +3, and +++ are equivalent. | |
/re/ | The line containing the pattern re, scanning forward (/) or backward (?). The trailing |
?re? | / or ? can be omitted if the line is only being displayed. If re is omitted, ex uses the |
| more recently set of either the scanning string or the substitution string (see Regular |
| Expressions below). |
'x | Lines can be marked using single lowercase letters (see the mark command in Com- |
| mand Descriptions below). 'x refers to the line marked with x. In addition, the pre- |
| vious current line is marked before each nonrelative motion. This line can be referred |
| to by using ' for x (thus '' refers to the previous current line). |
| (XPG4 only.) Commands require zero, one or two addresses. Commands that require |
| zero addresses shall regard the presence of an address as an error. |
(XPG4 only.) Adjacent address in a range shall be separated from each other by a comma (,) or a semi- colon(;). In the latter case, the current line(.) shall be set to the ®rst address, and only then is the second address calculated. This feature can be ued to determine the starting line for forwards and backwards searches. The second address of any
Addresses for commands consist of a series of line addresses (speci®ed as above), separated by a comma (,) or semicolon (;). Such address lists are evaluated
Regular Expression
The editor maintains copies of two regular expression strings at all times: the substitution string, and the scanning string. The substitute command sets the substitution string to the regular expression used. Both the
The editor supports Basic Regular Expressions (see regexp(5)) with the following modi®cations:
\< | The \< matches the beginning of a "word"; that is, the matched string must begin in a |
| letter, digit, or underline, and must be preceded by the beginning of the line or a charac- |
| ter other than the above. This construct can only be used at the beginning of a regular |
| expression (as in \<word), but not in the middle (word1 \<word2). |
\> | The \> matches the end of a "word" (see previous paragraph). This construct can only be |
| used at the end of a regular expression (as in word\>), but not in the middle (word1\> |
| word2). |
~Match the replacement part of the last substitute command.
[string] The positional quoting within bracket expressions de®ned by Basic Regular Expressions is replaced by the use of the backslash (\) to quote
nomagic When the editor option nomagic is set, the only characters with special meanings are à at the beginning of a pattern, $ at the end of a pattern, and \. The characters ., *, [, and Ä lose their special meanings unless escaped by a \.
Replacement Strings
The character & in the replacement string stands for the text matched by the pattern to be replaced. Use \& if the nomagic editor option is set.
The character Ä is replaced by the replacement part of the previous substitute command. Use \Ä if the nomagic editor option is set.
The sequence \n, where n is an integer, is replaced by the text matched by the subpattern enclosed in the nth set of parentheses \( and \).
e
− 3 − | Section 1−243 |