regex - Vim Error E488: Trailing characters on substitution with gn flags -


i trying count occurrences of regex in vim following command:

:%s/class=//gn 

or even:

:%s/class=/&/gn 

but keep getting e488: trailing characters. suggested in official documentation http://vimdoc.sourceforge.net/htmldoc/tips.html#count-items

can help/explain ? way have found out working :%s/class=/&/g in opinion little overkill since substitutes regex same characters tat have been found instead of counting occurrences.

i using vim 6.3

after searching found in :help improvements-7:

to count items (pattern matches) without changing buffer 'n' flag has been added :substitute.

thus have upgrade 7.0 @ least. :-)


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -