''' <summary>
''' 半角英数のチェック
''' </summary>
''' <param name="str"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function f_IsAlphameric(ByVal str As String) As Boolean
Return Regex.IsMatch(str, "^[a-zA-Z0-9]+$")
End Function
''' <summary>
''' 半角カタカナ
''' </summary>
''' <param name="str"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function f_IsHankakuKana(ByVal str As String) As Boolean
Return Regex.IsMatch(str, "[\uFF61-\uFF9F]")
End Function
''' <summary>
''' 半角記号
''' </summary>
''' <param name="str"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function f_IsHankakuKigou(ByVal str As String) As Boolean
Return Regex.IsMatch(str, "^[ -/:-@\[-\`\{-\~]+$")
End Function
''' <summary>
''' 半角カナ・半角英数字・半角記号チェック
''' </summary>
''' <param name="str"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function f_IsHankakuKanaOrAlphamericOrKigou(ByVal str As String)
For Each s_code As String In str
If Not (f_IsHankakuKana(s_code) OrElse f_IsAlphameric(s_code) OrElse f_IsHankakuKigou(s_code)) Then
Return False
End If
Next
Return True
End Function
''' <summary>
''' 全角チェック
''' </summary>
''' <param name="str"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function f_IsZenkaku(ByVal str As String) As Boolean
Return Regex.IsMatch(str, "^[^ -~。-゚]+$")
End Function