Dim someText As String = "Process Value 321 is Too High" someText = Regex.Replace(someText, "\d+", Function(n) n.Value.PadLeft(8, "0"c)) ' ouput of someText = "Process Value 00000321 is Too High"