ник: Lukas
СилЫч, я вспомнил:
Function rgxpnum2(LookIn$)
With GetRegX()
rgxpnum2 = .Replace(LookIn, "")
End With
End Function
Private Function GetRegX() As Object
Static RegX As Object
If RegX Is Nothing Then
Set RegX = CreateObject("VBScript.RegExp")
With RegX
.Pattern = "[^0-9]"
.Global = True
End With
End If
Set GetRegX = RegX
End Function
|
Рез-ты теста:
qwerty123.456qwerty 100000
---------------------------
ComposeIndexC 1484 123456
rgxpnum2 843 123456
qwerty123.45qwerty qwerty123.45qwerty 100000
---------------------------
ComposeIndexC 1765 1234512345
rgxpnum2 1188 1234512345
|