/ Published in: ASP
similar to php ereg_replace. You can pass this pattern [^A-Za-z0-9] and "" to remove from string non alphanumerical chars:
s = ereg_replace("[^A-Za-z0-9]","",s)
I use this function to clean input fields...
Expand |
Embed | Plain Text
function ereg_replace(pattern,change,str) Dim ObjRegexp Set ObjRegexp = New RegExp ObjRegexp.Global = True ObjRegexp.IgnoreCase = True ObjRegexp.Pattern = pattern str = ObjRegexp.Replace(str,change) Set ObjRegexp = Nothing ereg_replace = str end Function
You need to login to post a comment.
