lcString = 'abc1234567890123456fd' loRegExp = CREATEOBJECT("VBScript.Regexp") loRegExp.PATTERN = "\D\d{16}\D*" && search for non digit following by 16 digits loRegExp.IgnoreCase = .T. loRegExp.GLOBAL = .T. loMatches = loRegExp.Execute(lcString) lnMatches = loMatches.Count && Number of matches FOR lnMatch = 0 TO (lnMatches - 1) ?loMatches.Item(lnMatch).FirstIndex && Start position ?loMatches.Item(lnMatch).value ENDFORI am looking for a way to identify a 16 digit number preceeding by any non-digit character and ending with non-digit character or nothing. The pattern I defined seems to work. However, I need to replace only that 16 digit number with the 16X. I am not sure how to apply Replace command here.