[comp.editors] tilde in vi regular expression

vojta@math.berkeley.edu (Paul Vojta) (11/19/88)

What does the tilde do in a vi regular expression?  For example, if my file
contains the lines
	xy
	x~y
and I do /x~y, then it finds the first line and not the second.  This is in
vi version 3.7 on a 4.3bsd Sun; it does it on a vax, too.

hansm@cwi.nl (Hans Mulder) (11/23/88)

In article <17243@agate.BERKELEY.EDU> vojta@math.berkeley.edu (Paul Vojta) writes:
>What does the tilde do in a vi regular expression?  For example, if my file
>contains the lines

When you have done :s/pattern/replacement/, the tilde matches the replacement.

Hans Mulder	hansm@cwi.nl	mcvax!hansm

boykin@multimax.Encore.COM (Joe Boykin) (12/01/88)

In article <17243@agate.BERKELEY.EDU> vojta@math.berkeley.edu (Paul Vojta) writes:
>What does the tilde do in a vi regular expression?  For example, if my file
>contains the lines
>	xy
>	x~y
>and I do /x~y, then it finds the first line and not the second.  This is in
>vi version 3.7 on a 4.3bsd Sun; it does it on a vax, too.


The tilde specifies the replacement text from the most recent substitute
command.  For example:

	:s/foo/bar/
	/~/

would search for "bar".

----

Joe Boykin
Encore Computer Corp
Chairman, IEEE Computer Societies
    Technical Committee on Operating Systems

UUCP: encore!boykin
ARPA: boykin@encore.com