actually we do not need the second pair of brackets in #1 making it a very little bit shorter: > > 1. get matchText(myFile,"([^.jpg])$", a); put > replaceText(myFile,"[^.jpg]$",a & ".jpg") into myFile > 2. replaceText(myFile,".jpg","") > > best wishes :-) > Viktoras