in reply to Re^4: A text replacement question
in thread A text replacement question

That sure helps.

You can do this via a one-liner or via real code.

(untested one-liner):

perl -pi.bak -e 's/(?!<NAME)(\w{2}v\w{2})/&replace($1)/ieg; BEGIN { sub replace { my $name = shift; return "<input type=..... name=$name>...."; } }' *.html

All you need to do now, is modify the replace subroutine.