<% ' Comersus Sophisticated Cart ' Comersus Open Technologies ' USA - 2006 ' http://www.comersus.com ' Details: string functions %> <% function getLoginField(input,stringLength) ' to filter login fields dim regEx Set regEx = New RegExp getLoginField = left(trim(input),stringLength) regEx.Pattern = "([^-_A-Za-z0-9@.])" regEx.IgnoreCase = True regEx.Global = True getLoginField = regEx.Replace(getLoginField, "") Set regEx = nothing end function function getScreenMessage(input,stringLength) ' to filter screenMessage dim regEx Set regEx = New RegExp getScreenMessage = left(trim(input),stringLength) regEx.Pattern = "([^-_A-Za-z0-9@., ])" regEx.IgnoreCase = True regEx.Global = True getScreenMessage = regEx.Replace(getScreenMessage, "") Set regEx = nothing end function function getUserInput(input, stringLength) dim newString, regEx Set regEx = New RegExp ' only specified length newString = left(trim(input),stringLength) if pFilteringLevel=1 then regEx.Pattern = "([^A-Za-z0-9@=:/*|' _-]+.%)" regEx.IgnoreCase = True regEx.Global = True newString = regEx.Replace(newString, "") Set regEx = nothing newString = replace(newString,"--","") newString = replace(newString,";","") newString = replace(newString,"'","'") newString = replace(newString,"