1 ' ----------------------------------------------------
2 '
3 ' Regular cleaning of input strings.
4 '
5 ' Remove characters not in [a-zA-Z0-9 _]
6 ' Delete words script | JavaScript | VBScript | JScript
7 '
8 '
9 ' ----------------------------------------------------
10 Public Shared Function cleanstringregex () Function Cleanstringregex ( Byval Inputtext As String ) As String
11 Dim Options As Regexoptions = Regexoptions. ignorecase
12 Return Replaceregex (inputtext, " [^ \\\.!? "" ', \-\ W \ s @] " , Options)
13 End Function ' Cleanstringregex
14
15 ' ----------------------------------------------------------
16 ' Removes Design Characters from input strings using regular expressions
17 ' RegEx (regularexpression, options) uses the modify mode option to initialize and compile the RegEx class instance for the specified regular expression.
18 ' ----------------------------------------------------
19
20 Private Shared Function replaceregex () Function Replaceregex ( Byval Inputtext As String , Byval Regularexpression As String , Byval Options As Regexoptions) As String
21 Dim RegEx As New RegEx (regularexpression, options)
22 Return RegEx. Replace (inputtext, "" )
23 End Function ' Replaceregex
'