Classic ASP – Strip Special Character Function


<%
Function StripSpecialChar(strInput)
	Dim objRegExp
	Set objRegExp = New Regexp
	objRegExp.IgnoreCase = True
	objRegExp.Global = True
	objRegExp.Pattern = "[\+\#\@\&\%\$\?\*]"
	'//Replace all character matches with an Empty String
	StripSpecialChar = objRegExp.Replace(strInput, "")
	Set objRegExp = Nothing
End Function
%>

source: https://gist.github.com/gwobcke/1027138/revisions


Comments are closed.