/ 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...
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
Copy this code and paste it in your HTML
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