Ralph Shumaker wrote:
I want to know how to use vi to do search and replace. Is there something easier to use than "help" to find out how?

I want to replace all instances of
"^[0-9][A-Z]" with
"^[0-9] [A-Z]".

You need to approach this sideways. A regular expression replacement probably doesn't do what you need as you would have to capture the matched characters, save them to a group, and then forward those groups to the replacement expression.

It might be possible, but it would be annoying.

I know this doesn't help you, but in Emacs I would do this with a macro.

I would start a macro, search for the [0-9][A-Z], go to where the space should be, insert the space, end the macro. Then I would execute the macro until it failed.

I'm sure that vi/vim has a similar facility, but you'd have to get one of the vi bigots to tell you how.

-a


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to