Ciao Matthias-Christian,

> Hi,
> how can I substitute a single word via regular expression?

The question is not very clear.
I suppose that you mean that you want to substitute a pattern that
appears as a single word, ie. surrounded by spaces.

In this case, you can use the command

:s/\(\s\+\)word\(\s\+\)/\1new_word\2/g

to change in the current line every occurrance of the word "word"
surrounded by spaces with the word "new_word" surrounded by the same
spaces.

HTH,

-- 
[ Andrea Spadaccini - a.k.a. Lupino - from Catania - ICQ #: 91528290 ]
[ GPG ID: 5D41ABF0 - key on keyservers - Gentoo GNU / Linux - 2.6.16 ]
[ Linux Registered User 313388 - @: a.spadaccini(at)catania.linux.it ]

Reply via email to