Reg Expr bugs in vi? - (nf)

emrath at uiuccsb.UUCP emrath at uiuccsb.UUCP
Sat Oct 1 19:27:57 AEST 1983


#R:uiuccsb:6300001:uiuccsb:6300002:000:983
uiuccsb!emrath    Oct  1 00:35:00 1983

Without knowing or caring what vi actually does, what would you
have it do?  The input file contains the line:

3333333333

The commands to be typed are:

1G/,*[0-9]\rnnnnn

I claim it should first put the cursor at the first 3 (column 1) (ok so far:-).
After the /,*[0-9]\r it should move the cursor to the second 3 (column 2).
For each n command, the cursor should move right 1 (one) column.

I believe that if the r.e. DOES match null (OR anything non-null, such as 3*),
the cursor should NOT move. The documentation for this case is ambiguous at
best. However, discussion of this case may continue independently of how vi
should act on the above example, where the pattern does NOT match null.


Apparently, vi doesn't know how to backtrack worth a damn (at all?).
Enter the word mississippi on a line, position the cursor on the first s in
the word, and search for issi. GOOD LUCK.

		Perry Emrath, Univ. of IL
		...{decvax|inuxc}!pur-ee!uiucdcs!emrath
		emrath.uiuc at rand-relay



More information about the Comp.bugs.4bsd.ucb-fixes mailing list