linux - Vim, find the n'th occurence of a word -


i tried using following syntax, in vim find n'th occurence of word(i replace word one)

:6:myword  

and replace newword

i not understand getting wrong, can me?

s/\%(\(myword\).\{-}\)\{6}\zs\1/newword/            ^             ^             ^             pattern       occurrence    replace pattern 

it replace 6th occurrence of myword newword.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -