> %s/tv\[/tv_/g
> replaces he first but how to distinguish the second from other
> similar cases.
%s/tv\[\(\d\+\)\]/tv_\1/
--
http://slobin.pp.ru/ `When I use a word,' Humpty Dumpty said,
<cy...@slobin.pp.ru> `it means just what I choose it to mean'
> %s/tv\[\(\d\+\)\]/tv_\1/
Oops! /g modifier forgotten!
%s/tv\[\(\d\+\)\]/tv_\1/g
i would use:
%s~tv\[\([^\]]*\)\]~tv_\1~g
which means replace "tv" followed by "[" followed by anything except a "]"
and save the content between "[" and "]" in \1 by tv_ and the saved
content in \1.
Kind regards
Chris