#21411
Stefan
Participant

Sorry, but with “document.selection.Replace” I get a mess like you have experienced, even replace ‘a’ by ‘X’ didn’t work for the whole example text.
 

nLines = document.GetLines();
var count=1;
for(L=1;L<nLines;L++){
	document.selection.SelectLine();
	//document.selection.Replace("\[1!#\d+\]","[1!#"+count+"]", eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
	document.selection.Replace("a","X", eeReplaceSelOnly | eeReplaceAll );
 	count++;
 	document.selection.LineDown();
}

 
 
Highly probable there is a trick I don’t get. Oh, and I use 15.7.0./ 32-bit portable here.