Inserting a character in certain column

Michael Ulm michael.ulm at
Wed Feb 27 12:32:08 UTC 2008

Gerald Dachs wrote:
> Quoting Michael Ulm <michael.ulm at>:
>>>> or use a regexp substitution. In command mode type
>>>> :%s/^.\{3}/&XY/
>> Are you sure you entered the regexp correctly? I have just verified
>> that the expression I gave works with various versions of vi/vim.
>> Things to look out for are to use curly braces {} not parentheses (),
>> and not to forget any character in the expression.
> I didn't test it, but I think the backslash before the closing
> curly brace is missing.

Good point. The backslash before the closing curly brace is optional
in vim, so I never put it in. However, some regexp engines may be more
unforgiving. Since we do not know which vi version Szemerédy is using
this may well be the reason for (his|her) problem.



More information about the ubuntu-users mailing list