Your code can be simplified
Private Function IsAlphaNum(ByVal strInputText As String) As Boolean
Dim IsAlpha As Boolean = False
If System.Text.RegularExpressions.Regex.IsMatch(strInputText, "^[a-zA-Z0-9]+$") Then
IsAlpha = True
Else
IsAlpha = False
End If
Return IsAlpha
End Function
to
Private Function IsAlphaNum(ByVal strInputText As String) As Boolean
Dim IsAlpha As Boolean = False
IsAlpha = System.Text.RegularExpressions.Regex.IsMatch(strInputText, "^[a-zA-Z0-9]+$")
Return IsAlpha
End Function
and to
Private Function IsAlphaNum(ByVal strInputText As String) As Boolean
Return System.Text.RegularExpressions.Regex.IsMatch(strInputText, "^[a-zA-Z0-9]+$")
End Function
In case you need more complicated RegEx:
Here is a link to RegEx documentation:
perlre - perldoc.perl.org[
^]
Here is links to tools to help build RegEx and debug them:
.NET Regex Tester - Regex Storm[
^]
Expresso Regular Expression Tool[
^]
This one show you the RegEx as a nice graph which is really helpful to understand what is doing a RegEx:
Debuggex: Online visual regex tester. JavaScript, Python, and PCRE.[
^]