Yo uso esta clase
Código:
class clsRegExp
private obj, pattern, gg, ic
property let setPattern(str)
pattern = str
end property
property let setGlobal(str)
gg = str
end property
property let setIgnoreCase(str)
ic = str
end property
property get strPattern
strPattern = pattern
end property
'*********************************************************************
' Initialization/Termination BOF
'*********************************************************************
'Initialize Class Members
Private Sub Class_Initialize()
pattern = ""
gg = true
ic = false
End Sub
'Terminate and unload all created objects
Private Sub Class_Terminate()
' Terminate
End Sub
'*********************************************************************
' Initialization/Termination EOF
'*********************************************************************
public function isValidData(esto)
dim obj, found
set obj = New RegExp
with obj
.Pattern = pattern
.Global = gg
.IgnoreCase = ic
end with
isValidData = obj.test(esto)
set obj = nothing
end function
public function substract(esto)
dim obj, found
set obj = New RegExp
with obj
.Pattern = pattern
.Global = gg
.IgnoreCase = ic
end with
Set Matches = obj.Execute(esto)
found = ""
for each m in Matches
found = found & m.value
next
substract = found
set obj = nothing
end function
end class
Para usarla, te dejo un ejemplo:
b = "4'32#frffwDDF-;"
set r = new clsRegExp
r.setPattern = "\w"
response.Write("<br>" & r.substract(b))
set r = nothing
espero te sirva
Un saludo