.\" @(#)e6 6.1 (Berkeley) 5/22/86
You may have noticed that things just don't work right when you used
context searches and the substitute command.
The reason is rather complex, although the cure is simple.
treats these characters as special, with special meanings.
in a context search or the first string of the substitute command only,
means ``any character,'' not a period, so
A complete list of the special characters
that can cause trouble is the following:
If you have to use one of the special characters
you can turn off its magic meaning temporarily
by preceding it with the backslash.
s/\e\e\e\*.\e*/backslash dot star/
into ``backslash dot star''.
Here is a hurried synopsis of the other special characters.
only if it is at the beginning of a line:
is just the opposite of the circumflex;
it means the end of a line:
will only find an occurrence of
that is at the end of some line.
will find only a line that contains just
finds a line containing exactly one character.
This is useful in conjunction with
which is a repetition character;
is a shorthand for ``any number of
matches any number of anythings.
which changes an entire line,
which deletes all characters in the line up to and
including the last comma.
finds the longest possible match,
this goes up to the last comma.)
to form ``character classes'';
matches any single digit \-
any one of the characters inside the braces
This can be abbreviated to
is another shorthand character \-
it is used only on the right-hand part of a substitute command
where it means ``whatever was matched on the left-hand side''.
It is used to save typing.
Suppose the current line contained
and you wanted to put parentheses around it.
You could just retype the line, but
But the easiest way uses the
This says ``match the whole line, and replace it
by itself surrounded by parentheses.''
can be used several times in a line;
Now is the time? Now is the time!!
You don't have to match the whole line, of course:
the end of the world is at hand
Observe this expression carefully,
for it illustrates how to take advantage of
saves you from typing it again.
is a special character only within
the replacement text of a substitute command,
and has no special meaning elsewhere.
You can turn off the special meaning of
will convert the word ``ampersand'' into the literal symbol