using System . Text . RegularExpressions;
string str = textBox1 . Text;
MatchCollection vMatches = Regex . Matches(str, @">(\[m.v\])</" );
for ( int i = vMatches . Count - 1 ; i >= 0 ; i -- )
{
str = str . Remove(vMatches[i] . Groups[ 1 ] . Index,
vMatches[i] . Groups[ 1 ] . Value . Length);
str = str . Insert(vMatches[i] . Groups[ 1 ] . Index, i . ToString());
}
textBox2 . Text = str;