Reputation: 3
I have a file that looks like this:
aaaaaaaaaaa bbbb ccccccc
dddd eeeeeeeee ffffff
and for each line I would like to replace the first word with "text":
text bbbb ccccccc
text eeeeeeee ffffff
Upvotes: 0
Views: 2459
Reputation: 4476
You can use the following regex:
:%s/^\w\+/text/
\w
is a word character.
Upvotes: 10