呵呵,我再来个不用正则表达式的:
Dim nms() As String = {"08476R","MAR480","00039ER","00076EN","00940SE","08835E","GJP123"}
For Each nm As String In nms
Dim v As String = nm.SubString(nm.Length -2)
If Char.IsLetter(v.Chars(0)) AndAlso Char.IsLetter(v.Chars(1)) Then
If v.Chars(0) = "e" Then
output.show(nm & ":exp")
ElseIf v.Chars(0) = "s" Then
output.show(nm & "str")
End If
ElseIf Char.IsDigit(v.Chars(0)) AndAlso Char.IsLetter(v.Chars(1)) Then
output.show(nm & ":atm")
ElseIf Char.IsLetter(nm.Chars(0)) AndAlso Char.IsLetter(nm.Chars(1)) AndAlso Char.IsLetter(nm.Chars(2)) Then
output.show(nm & ":atm")
End If
Next