>lcStr = "a [1-2] b [2-3] c [3-4] d [4-5] e [5-6] ... [9-10]" > >loRegEx = NEWOBJECT("VBScript.RegExp") >loRegEx.Pattern = "\[([1-9])-([1-9])\]" >loRegEx.Global = .T. >lcNewStr = loRegEx.Replace(lcStr, "[0$1-0$2]") > >loRegEx.Pattern = "\[([1-9])-([1-9]\d)\]" >lcNewStr = loRegEx.Replace(lcNewStr, "[0$1-$2]") > > >? lcStr >? lcNewStrfantastic sergey - many thanks - works perfectly for me. I will spend the next couple of hours trying to figure out exactly what you've done.